1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00
Files
docs/commands/shell/shell_windows_test.go
David Gageot 5ff7ab91fb Extract shell detection to its own package
Signed-off-by: David Gageot <david@gageot.net>
2016-01-04 15:58:30 +01:00

25 lines
438 B
Go

package shell
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestDetect(t *testing.T) {
originalShell := os.Getenv("SHELL")
os.Setenv("SHELL", "")
defer os.Setenv("SHELL", originalShell)
shell, err := Detect()
assert.Nil(t, err)
assert.Equal(t, "cmd", shell)
}
func TestStartedBy(t *testing.T) {
shell, err := startedBy()
assert.Nil(t, err)
assert.NotNil(t, shell)
assert.Equal(t, "go.exe", shell)
}