From 6639f31c4a24fc4ceb47eeb91bddbb451ac1c906 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Thu, 6 Jul 2017 19:20:57 -0700 Subject: [PATCH] Fix some commands test --- command/alloc_status_test.go | 2 +- command/eval_status_test.go | 2 +- command/inspect_test.go | 2 +- command/job_revert_test.go | 2 +- command/node_status_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/command/alloc_status_test.go b/command/alloc_status_test.go index a213ce4b2..6eb5e7aa1 100644 --- a/command/alloc_status_test.go +++ b/command/alloc_status_test.go @@ -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) } } diff --git a/command/eval_status_test.go b/command/eval_status_test.go index b945cf770..de5bd6d87 100644 --- a/command/eval_status_test.go +++ b/command/eval_status_test.go @@ -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) } diff --git a/command/inspect_test.go b/command/inspect_test.go index 8d16106a3..413e10d5c 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -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) } } diff --git a/command/job_revert_test.go b/command/job_revert_test.go index fbc665bb9..01d9e4397 100644 --- a/command/job_revert_test.go +++ b/command/job_revert_test.go @@ -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") { diff --git a/command/node_status_test.go b/command/node_status_test.go index 8becbf012..0b5f398e4 100644 --- a/command/node_status_test.go +++ b/command/node_status_test.go @@ -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) } }