diff options
Diffstat (limited to 'spec/unit/knife/node_delete_spec.rb')
-rw-r--r-- | spec/unit/knife/node_delete_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/unit/knife/node_delete_spec.rb b/spec/unit/knife/node_delete_spec.rb index 04eca389c6..0941d850e5 100644 --- a/spec/unit/knife/node_delete_spec.rb +++ b/spec/unit/knife/node_delete_spec.rb @@ -26,41 +26,41 @@ describe Chef::Knife::NodeDelete do :print_after => nil } @knife.name_args = [ "adam" ] - @knife.stub(:output).and_return(true) - @knife.stub(:confirm).and_return(true) + allow(@knife).to receive(:output).and_return(true) + allow(@knife).to receive(:confirm).and_return(true) @node = Chef::Node.new() - @node.stub(:destroy).and_return(true) - Chef::Node.stub(:load).and_return(@node) + allow(@node).to receive(:destroy).and_return(true) + allow(Chef::Node).to receive(:load).and_return(@node) @stdout = StringIO.new - @knife.ui.stub(:stdout).and_return(@stdout) + allow(@knife.ui).to receive(:stdout).and_return(@stdout) end describe "run" do it "should confirm that you want to delete" do - @knife.should_receive(:confirm) + expect(@knife).to receive(:confirm) @knife.run end it "should load the node" do - Chef::Node.should_receive(:load).with("adam").and_return(@node) + expect(Chef::Node).to receive(:load).with("adam").and_return(@node) @knife.run end it "should delete the node" do - @node.should_receive(:destroy).and_return(@node) + expect(@node).to receive(:destroy).and_return(@node) @knife.run end it "should not print the node" do - @knife.should_not_receive(:output).with("poop") + expect(@knife).not_to receive(:output).with("poop") @knife.run end describe "with -p or --print-after" do it "should pretty print the node, formatted for display" do @knife.config[:print_after] = true - @knife.should_receive(:format_for_display).with(@node).and_return("poop") - @knife.should_receive(:output).with("poop") + expect(@knife).to receive(:format_for_display).with(@node).and_return("poop") + expect(@knife).to receive(:output).with("poop") @knife.run end end |