2016-01-03 03:01:46 +01:00
|
|
|
// +build !windows
|
|
|
|
|
|
2016-01-04 15:39:38 +01:00
|
|
|
package shell
|
2015-12-17 16:25:50 +01:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
)
|
|
|
|
|
|
2016-01-06 10:36:00 +01:00
|
|
|
func TestUnknownShell(t *testing.T) {
|
|
|
|
|
defer func(shell string) { os.Setenv("SHELL", shell) }(os.Getenv("SHELL"))
|
2015-12-17 16:25:50 +01:00
|
|
|
os.Setenv("SHELL", "")
|
2016-01-06 10:36:00 +01:00
|
|
|
|
2016-01-04 15:39:38 +01:00
|
|
|
shell, err := Detect()
|
2016-01-06 10:36:00 +01:00
|
|
|
|
2016-01-03 03:01:46 +01:00
|
|
|
assert.Equal(t, err, ErrUnknownShell)
|
2016-01-06 10:36:00 +01:00
|
|
|
assert.Empty(t, shell)
|
2015-12-17 16:25:50 +01:00
|
|
|
}
|