We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ceec9d7 commit 65d57e5Copy full SHA for 65d57e5
exec/exec.go
@@ -14,6 +14,7 @@ type Cmd interface {
14
Kill() error
15
Output() ([]byte, error)
16
Run() error
17
+ SetEnv([]string)
18
}
19
20
// Command is a hook for mocking
@@ -28,3 +29,7 @@ type realCmd struct {
28
29
func (c *realCmd) Kill() error {
30
return c.Cmd.Process.Kill()
31
32
+
33
+func (c *realCmd) SetEnv(env []string) {
34
+ c.Cmd.Env = env
35
+}
test/exec/exec.go
@@ -68,6 +68,8 @@ func (c *mockCmd) Run() error {
68
return nil
69
70
71
+func (c *mockCmd) SetEnv([]string) {}
72
73
func (b *blockingReader) Read(p []byte) (n int, err error) {
74
<-b.quit
75
return 0, nil
0 commit comments