diff options
Diffstat (limited to 'spec/unit/knife/role_run_list_clear_spec.rb')
-rw-r--r-- | spec/unit/knife/role_run_list_clear_spec.rb | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/spec/unit/knife/role_run_list_clear_spec.rb b/spec/unit/knife/role_run_list_clear_spec.rb index 5e1a388c75..7559d73676 100644 --- a/spec/unit/knife/role_run_list_clear_spec.rb +++ b/spec/unit/knife/role_run_list_clear_spec.rb @@ -21,7 +21,7 @@ require "spec_helper" describe Chef::Knife::RoleRunListClear do before(:each) do - Chef::Config[:role_name] = "will" + Chef::Config[:role_name] = "will" @setup = Chef::Knife::RoleRunListAdd.new @setup.name_args = [ "will", "role[monkey]", "role[person]" ] @@ -38,14 +38,9 @@ describe Chef::Knife::RoleRunListClear do allow(@knife.ui).to receive(:confirm).and_return(true) allow(Chef::Role).to receive(:load).and_return(@role) - end - - describe "run" do - - # it "should display all the things" do # @knife.run # @role.to_json.should == 'show all the things' @@ -56,35 +51,32 @@ describe Chef::Knife::RoleRunListClear do @knife.run end - it "should remove the item from the run list" do - @setup.run - @knife.run - expect(@role.run_list[0]).to be_nil - end + it "should remove the item from the run list" do + @setup.run + @knife.run + expect(@role.run_list[0]).to be_nil + end - it "should save the node" do - expect(@role).to receive(:save).and_return(true) - @knife.run - end + it "should save the node" do + expect(@role).to receive(:save).and_return(true) + @knife.run + end - it "should print the run list" do - expect(@knife).to receive(:output).and_return(true) - @knife.config[:print_after] = true - @setup.run - @knife.run - end + it "should print the run list" do + expect(@knife).to receive(:output).and_return(true) + @knife.config[:print_after] = true + @setup.run + @knife.run + end - describe "should clear an environmental run list of roles and recipes" do - it "should remove the items from the run list" do - @setup.name_args = [ "will", "recipe[orange::chicken]", "role[monkey]", "recipe[duck::type]", "role[person]", "role[bird]", "role[town]" ] - @setup.run - @knife.name_args = [ "will" ] - @knife.run - expect(@role.run_list[0]).to be_nil - end - end + describe "should clear an environmental run list of roles and recipes" do + it "should remove the items from the run list" do + @setup.name_args = [ "will", "recipe[orange::chicken]", "role[monkey]", "recipe[duck::type]", "role[person]", "role[bird]", "role[town]" ] + @setup.run + @knife.name_args = [ "will" ] + @knife.run + expect(@role.run_list[0]).to be_nil + end + end end end - - - |