1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/vendor/gotest.tools/icmd/example_test.go

22 lines
409 B
Go

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",
})
}