mock shell in test

pull/8334/head
Marcin Niemira 2020-05-31 15:58:56 +10:00
parent ae2ceee8e4
commit 366d6c370c
No known key found for this signature in database
GPG Key ID: 053E25BDC33ED6A3
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ package shell
import (
"bytes"
"os"
"strings"
"testing"
)
@ -116,6 +117,7 @@ set -e bar;`},
}
func TestDetect(t *testing.T) {
os.Setenv("SHELL", "bash")
if s, err := Detect(); err != nil {
t.Fatalf("unexpected error: '%v' during shell detection. Returned shell: %s", err, s)
} else if s == "" {