Read test

This commit is contained in:
Mike Farah 2018-06-15 08:38:30 +10:00
parent be08214773
commit be991fdacd
1 changed files with 9 additions and 0 deletions

View File

@ -128,6 +128,15 @@ func TestReadCmd(t *testing.T) {
assertResult(t, "2\n", result.Output) assertResult(t, "2\n", result.Output)
} }
func TestReadMultiCmd(t *testing.T) {
cmd := getRootCommand()
result := runCmd(cmd, "read -d 1 examples/multiple_docs.yaml another.document")
if result.Error != nil {
t.Error(result.Error)
}
assertResult(t, "here\n", result.Output)
}
func TestReadCmd_ArrayYaml(t *testing.T) { func TestReadCmd_ArrayYaml(t *testing.T) {
cmd := getRootCommand() cmd := getRootCommand()
result := runCmd(cmd, "read examples/array.yaml [0].gather_facts") result := runCmd(cmd, "read examples/array.yaml [0].gather_facts")