command/output: Update test since we now allow printing everything

This commit is contained in:
Radek Simko 2015-08-03 12:44:41 +01:00
parent 85d1d15d81
commit 382c0ba23d
1 changed files with 10 additions and 2 deletions

View File

@ -161,7 +161,8 @@ func TestOutput_blank(t *testing.T) {
&terraform.ModuleState{ &terraform.ModuleState{
Path: []string{"root"}, Path: []string{"root"},
Outputs: map[string]string{ Outputs: map[string]string{
"foo": "bar", "foo": "bar",
"name": "john-doe",
}, },
}, },
}, },
@ -181,9 +182,16 @@ func TestOutput_blank(t *testing.T) {
"-state", statePath, "-state", statePath,
"", "",
} }
if code := c.Run(args); code != 1 {
if code := c.Run(args); code != 0 {
t.Fatalf("bad: \n%s", ui.ErrorWriter.String()) t.Fatalf("bad: \n%s", ui.ErrorWriter.String())
} }
expectedOutput := "foo = bar\nname = john-doe\n"
output := ui.OutputWriter.String()
if output != expectedOutput {
t.Fatalf("Expected output: %#v\ngiven: %#v", expectedOutput, output)
}
} }
func TestOutput_manyArgs(t *testing.T) { func TestOutput_manyArgs(t *testing.T) {