diff options
Diffstat (limited to 'client/go/mock/process.go')
-rw-r--r-- | client/go/mock/process.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/go/mock/process.go b/client/go/mock/process.go new file mode 100644 index 00000000000..5105bed8b0c --- /dev/null +++ b/client/go/mock/process.go @@ -0,0 +1,19 @@ +package mock + +import "fmt" + +type Exec struct { + ProgramPath string + CombinedOutput string +} + +func (c *Exec) LookPath(name string) (string, error) { + if c.ProgramPath == "" { + return "", fmt.Errorf("no program path set in this mock") + } + return c.ProgramPath, nil +} + +func (c *Exec) Run(name string, args ...string) ([]byte, error) { + return []byte(c.CombinedOutput), nil +} |