summaryrefslogtreecommitdiff
path: root/spec/unit/knife
diff options
context:
space:
mode:
authorJulian C. Dunn <jdunn@getchef.com>2014-02-16 18:55:20 -0500
committerBryan McLellan <btm@getchef.com>2014-03-19 17:09:55 -0700
commit22de0d1ae84ed44ecfdeadade56e180ead6ef84b (patch)
tree7abb85559e382434488dd5043261e91137d0b999 /spec/unit/knife
parentc799a671f42931d5235fa8b90f04d642811fdd0d (diff)
downloadchef-22de0d1ae84ed44ecfdeadade56e180ead6ef84b.tar.gz
[CHEF-3812] Update test to check for ui.fatal
Diffstat (limited to 'spec/unit/knife')
-rw-r--r--spec/unit/knife/node_run_list_add_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/knife/node_run_list_add_spec.rb b/spec/unit/knife/node_run_list_add_spec.rb
index 3113ee9e0b..bd33a359a2 100644
--- a/spec/unit/knife/node_run_list_add_spec.rb
+++ b/spec/unit/knife/node_run_list_add_spec.rb
@@ -78,12 +78,13 @@ describe Chef::Knife::NodeRunListAdd do
end
describe "with both --after and --before specified" do
- it "should raise ArgumentError" do
+ it "exits with an error" do
@node.run_list << "role[acorns]"
@node.run_list << "role[barn]"
@knife.config[:before] = "role[acorns]"
@knife.config[:after] = "role[acorns]"
- lambda { @knife.run }.should raise_error ArgumentError
+ @knife.ui.should_receive(:fatal)
+ lambda { @knife.run }.should raise_error(SystemExit)
end
end
@@ -120,7 +121,7 @@ describe Chef::Knife::NodeRunListAdd do
end
end
- describe "with more than one role or recipe as different arguments and list separated by comas" do
+ describe "with more than one role or recipe as different arguments and list separated by commas" do
it "should add to the run list all the entries" do
@knife.name_args = [ "adam", "role[monkey]", "role[duck],recipe[bird::fly]" ]
@node.run_list << "role[acorns]"