Skip to content

Commit

Permalink
fix windows unit test (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanhitt authored Apr 19, 2021
1 parent 5ad2aad commit fe62a17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

test:
docker:
- image: circleci/golang:1.15
- image: circleci/golang:1.16

steps:
- checkout
Expand All @@ -53,7 +53,7 @@ jobs:
steps:
- checkout
- run: choco install make
- run: choco install golang --version 1.15
- run: choco install golang --version 1.16
- run: make test

integration:
Expand Down
7 changes: 6 additions & 1 deletion pkg/app/test_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ func Test_TestCommand_WithTitle(t *testing.T) {
}

func Test_TestCommand_WithConfig(t *testing.T) {
testSuite := "testdata/overwrite.yaml"
if runtime.GOOS == "windows" {
testSuite = "testdata/overwrite_windows.yaml"
}

out := captureOutput(func() {
context := TestCommandContext{Config: "testdata/default.yaml"}
TestCommand("testdata/overwrite.yaml", context)
TestCommand(testSuite, context)
})

assert.Contains(t, out, "✓ [local] key from overwrite")
Expand Down
10 changes: 10 additions & 0 deletions pkg/app/testdata/overwrite_windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tests:
key from overwrite:
command: echo %KEY%
stdout: foo
key does not overwrite:
config:
env:
KEY: bar
command: echo %KEY%
stdout: bar

0 comments on commit fe62a17

Please sign in to comment.