Skip to content

Commit

Permalink
Add test for --allow-empty flag in merge command
Browse files Browse the repository at this point in the history
  • Loading branch information
Renzo Crisóstomo authored and mikefarah committed Mar 21, 2019
1 parent 75c7d40 commit 23543ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,3 +1084,17 @@ c:
assertResult(t, expectedOutput, strings.Trim(gotOutput, "\n "))
assertResult(t, os.FileMode(int(0666)), info.Mode())
}

func TestMergeAllowEmptyCmd(t *testing.T) {
cmd := getRootCommand()
result := runCmd(cmd, "merge --allow-empty examples/data1.yaml examples/empty.yaml")
if result.Error != nil {
t.Error(result.Error)
}
expectedOutput := `a: simple
b:
- 1
- 2
`
assertResult(t, expectedOutput, result.Output)
}
2 changes: 2 additions & 0 deletions examples/empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# a: apple
# b: cat

0 comments on commit 23543ee

Please sign in to comment.