Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 8a286f2

Browse files
Merge pull request #119 from docker/fix_windows_test
Change assertion on error message to fix windows version of TestVersi…
2 parents 5329b2d + 2a59ffb commit 8a286f2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

e2e/version_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"testing"
2323

2424
"gotest.tools/v3/assert"
25+
is "gotest.tools/v3/assert/cmp"
2526
"gotest.tools/v3/env"
2627
"gotest.tools/v3/icmd"
2728

@@ -93,19 +94,16 @@ Provider: %s
9394
}
9495

9596
func TestVersionWithoutSnykOrConfig(t *testing.T) {
96-
cmd, configDir, cleanup := dockerCli.createTestCmd()
97+
cmd, _, cleanup := dockerCli.createTestCmd()
9798
defer cleanup()
9899

99100
// docker scan --version should fail with a clean error
100101
cmd.Command = dockerCli.Command("scan", "--accept-license", "--version")
101102
output := icmd.RunCmd(cmd).Assert(t, icmd.Expected{
102103
ExitCode: 1,
103104
}).Combined()
104-
expected := fmt.Sprintf(
105-
`failed to read docker scan configuration file. Please restart Docker Desktop: open %s/scan/config.json: no such file or directory
106-
`,
107-
configDir)
108-
assert.Equal(t, output, expected)
105+
expected := "failed to read docker scan configuration file. Please restart Docker Desktop"
106+
assert.Assert(t, is.Contains(output, expected))
109107
}
110108

111109
func getProviderVersion(env string) string {

0 commit comments

Comments
 (0)