Fix some commands test

This commit is contained in:
Alex Dadgar
2017-07-06 19:20:57 -07:00
parent f0a090c6e8
commit 6639f31c4a
5 changed files with 5 additions and 5 deletions

View File

@@ -70,7 +70,7 @@ func TestAllocStatusCommand_Fails(t *testing.T) {
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
t.Fatalf("expected getting formatter error, got: %s", out)
}
}

View File

@@ -49,7 +49,7 @@ func TestEvalStatusCommand_Fails(t *testing.T) {
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
t.Fatalf("expected getting formatter error, got: %s", out)
}

View File

@@ -49,7 +49,7 @@ func TestInspectCommand_Fails(t *testing.T) {
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
t.Fatalf("expected getting formatter error, got: %s", out)
}
}

View File

@@ -24,7 +24,7 @@ func TestJobRevertCommand_Fails(t *testing.T) {
}
ui.ErrorWriter.Reset()
if code := cmd.Run([]string{"-address=nope", "foo"}); code != 1 {
if code := cmd.Run([]string{"-address=nope", "foo", "1"}); code != 1 {
t.Fatalf("expected exit code 1, got: %d", code)
}
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Error listing jobs") {

View File

@@ -206,7 +206,7 @@ func TestNodeStatusCommand_Fails(t *testing.T) {
if code := cmd.Run([]string{"-address=" + url, "-json", "-t", "{{.ID}}"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both -json and -t are not allowed") {
if out := ui.ErrorWriter.String(); !strings.Contains(out, "Both json and template formatting are not allowed") {
t.Fatalf("expected getting formatter error, got: %s", out)
}
}