Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make shell test work universally (hopefully) #585

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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