blob: 130ae203adff3cd9b353d2620d0e525d9a319875 [file] [log] [blame]
package icmd_test
import (
"testing"
"gotest.tools/icmd"
)
var t = &testing.T{}
func ExampleRunCommand() {
result := icmd.RunCommand("bash", "-c", "echo all good")
result.Assert(t, icmd.Success)
}
func ExampleRunCmd() {
result := icmd.RunCmd(icmd.Command("cat", "/does/not/exist"))
result.Assert(t, icmd.Expected{
ExitCode: 1,
Err: "cat: /does/not/exist: No such file or directory",
})
}