Skip to content

Commit

Permalink
make shell test work universally (hopefully) (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
intrand committed Apr 26, 2022
1 parent 25ceb57 commit 14a5cd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/course/shellSecrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package course

import (
"regexp"
"testing"

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

0 comments on commit 14a5cd2

Please sign in to comment.