diff options
author | Julian C. Dunn <jdunn@getchef.com> | 2014-02-16 18:55:20 -0500 |
---|---|---|
committer | Bryan McLellan <btm@getchef.com> | 2014-03-19 17:09:55 -0700 |
commit | 22de0d1ae84ed44ecfdeadade56e180ead6ef84b (patch) | |
tree | 7abb85559e382434488dd5043261e91137d0b999 /spec/unit/knife | |
parent | c799a671f42931d5235fa8b90f04d642811fdd0d (diff) | |
download | chef-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.rb | 7 |
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]" |