Skip to content

Commit 14a5cd2

Browse files
authored
make shell test work universally (hopefully) (#585)
1 parent 25ceb57 commit 14a5cd2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/course/shellSecrets_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package course
1616

1717
import (
18+
"regexp"
1819
"testing"
1920

2021
"github.com/stretchr/testify/assert"
@@ -117,8 +118,9 @@ func Test_newShellExecutor(t *testing.T) {
117118
if tt.wantErr {
118119
assert.Error(t, err)
119120
} else {
120-
assert.NoError(t, err)
121-
assert.EqualValues(t, tt.want, got)
121+
assert.NoError(t, err) // check for errors generally
122+
assert.Regexp(t, regexp.MustCompile("^.+bin/echo$"), got.Executable, "") // handle any *bin/echo, such as /usr/bin/echo
123+
assert.EqualValues(t, tt.want.Args, got.Args) // also verify args
122124
}
123125
})
124126
}

0 commit comments

Comments
 (0)