Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #119 from docker/fix_windows_test
Browse files Browse the repository at this point in the history
Change assertion on error message to fix windows version of TestVersi…
  • Loading branch information
silvin-lubecki authored Oct 28, 2020
2 parents 5329b2d + 2a59ffb commit 8a286f2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions e2e/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"testing"

"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/env"
"gotest.tools/v3/icmd"

Expand Down Expand Up @@ -93,19 +94,16 @@ Provider: %s
}

func TestVersionWithoutSnykOrConfig(t *testing.T) {
cmd, configDir, cleanup := dockerCli.createTestCmd()
cmd, _, cleanup := dockerCli.createTestCmd()
defer cleanup()

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

func getProviderVersion(env string) string {
Expand Down

0 comments on commit 8a286f2

Please sign in to comment.