Switching execpipe output to io.Reader

This commit is contained in:
Frederick F. Kautz IV
2014-12-20 21:57:27 +13:00
parent d1fe8beff5
commit 14dec50fef
2 changed files with 11 additions and 6 deletions
+6 -2
View File
@@ -3,9 +3,11 @@
package utils
import (
. "gopkg.in/check.v1"
"io/ioutil"
"os/exec"
"testing"
. "gopkg.in/check.v1"
)
type MySuite struct{}
@@ -29,6 +31,8 @@ func (s *MySuite) TestPiping(c *C) {
// Run
output, err := ExecPipe(ls, sort)
c.Assert(err, IsNil)
c.Assert(len(output), Not(Equals), 0)
outputBytes, err := ioutil.ReadAll(output)
c.Assert(err, IsNil)
c.Assert(len(outputBytes), Not(Equals), 0)
}
}