Simplify tests that use StubExecCommand

This commit is contained in:
Mislav Marohnić 2019-11-11 17:04:26 +01:00
parent 65054fdc6e
commit 6aa0c071d6
4 changed files with 30 additions and 34 deletions

View file

@ -11,11 +11,6 @@ import (
"github.com/spf13/cobra"
)
type ExecStub struct {
Stdout string
ExitCode int
}
func GetTestHelperProcessArgs() []string {
args := os.Args
for len(args) > 0 {
@ -28,11 +23,6 @@ func GetTestHelperProcessArgs() []string {
return args
}
func GetExecStub(outputs map[string]ExecStub) ExecStub {
args := GetTestHelperProcessArgs()
return outputs[args[0]]
}
func SkipTestHelperProcess() bool {
return os.Getenv("GO_WANT_HELPER_PROCESS") != "1"
}