summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-04-28 12:53:04 -0700
committertylercloke <tylercloke@gmail.com>2015-04-28 12:53:04 -0700
commit5d96b0aaf1b32de3bd62199d4d438bd6d540bc77 (patch)
tree0b8ab80527150dfda177ae96364780c4a40526cd
parente17fcb67c878b8c4d64ea1992556690f6f508e1c (diff)
downloadchef-tc/create-key.tar.gz
-rw-r--r--lib/chef/knife/client_key_create.rb2
-rw-r--r--lib/chef/knife/user_key_create.rb2
-rw-r--r--spec/unit/knife/key_create_spec.rb8
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/client_key_create.rb b/lib/chef/knife/client_key_create.rb
index 372655b7ab..2d9b49789a 100644
--- a/lib/chef/knife/client_key_create.rb
+++ b/lib/chef/knife/client_key_create.rb
@@ -82,7 +82,7 @@ class Chef
if @actor.nil?
show_usage
ui.fatal(actor_missing_error)
- return 1
+ exit 1
end
end
end
diff --git a/lib/chef/knife/user_key_create.rb b/lib/chef/knife/user_key_create.rb
index 4434ec87b3..ebde7188f4 100644
--- a/lib/chef/knife/user_key_create.rb
+++ b/lib/chef/knife/user_key_create.rb
@@ -82,7 +82,7 @@ class Chef
if @actor.nil?
show_usage
ui.fatal(actor_missing_error)
- return 1
+ exit 1
end
end
end
diff --git a/spec/unit/knife/key_create_spec.rb b/spec/unit/knife/key_create_spec.rb
index a02573b486..1bdd0f3ba1 100644
--- a/spec/unit/knife/key_create_spec.rb
+++ b/spec/unit/knife/key_create_spec.rb
@@ -42,16 +42,16 @@ describe "key create commands that inherit knife" do
context "when apply_params! is called with invalid args" do
it "shows the usage" do
expect(command).to receive(:show_usage)
- command.apply_params!(params)
+ expect { command.apply_params!(params) }.to exit_with_code(1)
end
it "outputs the proper error" do
- command.apply_params!(params)
+ expect { command.apply_params!(params) }.to exit_with_code(1)
expect(stderr.string).to include(command.actor_missing_error)
end
- it "returns 1" do
- expect(command.apply_params!(params)).to eq(1)
+ it "exits 1" do
+ expect { command.apply_params!(params) }.to exit_with_code(1)
end
end
end # before apply_params! is called