mock shell in test
parent
ae2ceee8e4
commit
366d6c370c
pkg/minikube/shell
|
@ -18,6 +18,7 @@ package shell
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -116,6 +117,7 @@ set -e bar;`},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDetect(t *testing.T) {
|
func TestDetect(t *testing.T) {
|
||||||
|
os.Setenv("SHELL", "bash")
|
||||||
if s, err := Detect(); err != nil {
|
if s, err := Detect(); err != nil {
|
||||||
t.Fatalf("unexpected error: '%v' during shell detection. Returned shell: %s", err, s)
|
t.Fatalf("unexpected error: '%v' during shell detection. Returned shell: %s", err, s)
|
||||||
} else if s == "" {
|
} else if s == "" {
|
||||||
|
|
Loading…
Reference in New Issue