Simplify tests that use StubExecCommand
This commit is contained in:
parent
65054fdc6e
commit
6aa0c071d6
4 changed files with 30 additions and 34 deletions
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue