Update failing tests

This commit is contained in:
Jake Champlin 2016-06-23 11:28:17 -04:00
parent ac724e2800
commit f094969c7b
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
2 changed files with 9 additions and 4 deletions

View File

@ -21,7 +21,7 @@ func TestHostFingerprint(t *testing.T) {
} }
// Host info // Host info
for _, key := range []string{"os.name", "os.version", "hostname", "kernel.name"} { for _, key := range []string{"os.name", "os.version", "unique.hostname", "kernel.name"} {
assertNodeAttributeContains(t, node, key) assertNodeAttributeContains(t, node, key)
} }
} }

View File

@ -66,7 +66,7 @@ func TestRunCommand_Fails(t *testing.T) {
if code := cmd.Run([]string{"/unicorns/leprechauns"}); code != 1 { if code := cmd.Run([]string{"/unicorns/leprechauns"}); code != 1 {
t.Fatalf("expect exit 1, got: %d", code) t.Fatalf("expect exit 1, got: %d", code)
} }
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Error parsing") { if out := ui.ErrorWriter.String(); !strings.Contains(out, "Error opening") {
t.Fatalf("expect parsing error, got: %s", out) t.Fatalf("expect parsing error, got: %s", out)
} }
ui.ErrorWriter.Reset() ui.ErrorWriter.Reset()
@ -181,7 +181,12 @@ job "job1" {
}() }()
args := []string{"-"} args := []string{"-"}
if code := cmd.Run(args); code != 0 { if code := cmd.Run(args); code != 1 {
t.Fatalf("expected exit code 0, got %d: %q", code, ui.ErrorWriter.String()) t.Fatalf("expected exit code 1, got %d: %q", code, ui.ErrorWriter.String())
} }
if out := ui.ErrorWriter.String(); !strings.Contains(out, "connection refused") {
t.Fatalf("expected runtime error, got: %s", out)
}
ui.ErrorWriter.Reset()
} }