(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestCommandCaptureStdout(t *testing.T) { |
| 67 | const expect = "echo to stdout\n" |
| 68 | ctx := log.Testing(t) |
| 69 | buf := &bytes.Buffer{} |
| 70 | err := shell.Command("echo", "echo to stdout").Capture(buf, nil).Run(ctx) |
| 71 | assert.For(ctx, "err").ThatError(err).Succeeded() |
| 72 | assert.For(ctx, "buf").ThatString(buf).Equals(expect) |
| 73 | } |
| 74 | |
| 75 | func TestCommandCaptureStderr(t *testing.T) { |
| 76 | const expect = "print to stderr\n" |