summaryrefslogtreecommitdiff
path: root/runner/shell/shell_test.go
blob: b28bd6c608d98c52476f5b786fed9a83bc7326fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package shell

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func TestShell_ShellByFilename(t *testing.T) {
	s := &shell{
		Locations: map[string]string{"powershell": "/pws", "bash": "/bash"},
	}
	inputs := map[string]string{
		"script.ps1": "/pws",
		"script.sh":  "/bash",
		"asdf":       "",
	}

	for k, v := range inputs {
		sh := s.ShellByFilename(k)
		assert.Equal(t, sh, v)
	}
}