Skip to content

Commit

Permalink
modify unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RafPe committed Feb 16, 2023
1 parent ed8b89d commit 0f27c08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ providers:
auth:
ssh_key: ssh:key:2312312
providerType: github
`), strings.TrimSpace(result))
`), strings.TrimSpace(string(result)))
}

func TestMergeYAML_MissingFile(t *testing.T) {
result, err := MergeYAML("tests/test1.yaml", "tests/test3.yaml")
assert.Error(t, err)
assert.Contains(t, err.Error(), "no such file or directory")
assert.Equal(t, "", result)
assert.Equal(t, "", string(result))
}

func TestMergeYAML_InvalidYAML(t *testing.T) {
result, err := MergeYAML("tests/test1.yaml", "tests/invalid.yaml")
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to unmarshal data from file")
assert.Equal(t, "", result)
assert.Equal(t, "", string(result))
}

0 comments on commit 0f27c08

Please sign in to comment.