From 1c0b7ed6f922da81ecd05e279ee268c60706d68d Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Fri, 24 Mar 2017 17:45:03 +0100 Subject: debugging failing test Signed-off-by: Stephan Renatus --- spec/unit/runner_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/unit/runner_spec.rb b/spec/unit/runner_spec.rb index ea721965c7..4b246fc35e 100644 --- a/spec/unit/runner_spec.rb +++ b/spec/unit/runner_spec.rb @@ -122,26 +122,26 @@ describe Chef::Runner do it "should raise exceptions as thrown by a provider" do provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context) - allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) - allow(provider).to receive(:action_sell).once.and_raise(ArgumentError) + expect(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) + expect(provider).to receive(:action_sell).once.and_raise(ArgumentError) expect { runner.converge }.to raise_error(ArgumentError) end it "should not raise exceptions thrown by providers if the resource has ignore_failure set to true" do allow(run_context.resource_collection[0]).to receive(:ignore_failure).and_return(true) provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context) - allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) - allow(provider).to receive(:action_sell).once.and_raise(ArgumentError) + expect(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) + expect(provider).to receive(:action_sell).once.and_raise(ArgumentError) expect { runner.converge }.not_to raise_error end it "should retry with the specified delay if retries are specified" do first_resource.retries 3 provider = Chef::Provider::SnakeOil.new(run_context.resource_collection[0], run_context) - allow(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) - allow(provider).to receive(:action_sell).and_raise(ArgumentError) + expect(Chef::Provider::SnakeOil).to receive(:new).once.and_return(provider) + expect(provider).to receive(:action_sell).exactly(3).times.and_raise(ArgumentError) expect(first_resource).to receive(:sleep).with(2).exactly(3).times - expect { runner.converge }.to raise_error(ArgumentError) + # expect { runner.converge }.to raise_error(ArgumentError) end it "should execute immediate actions on changed resources" do -- cgit v1.2.1