diff options
author | Stephan Renatus <srenatus@chef.io> | 2017-03-24 17:45:03 +0100 |
---|---|---|
committer | Stephan Renatus <srenatus@chef.io> | 2017-03-24 17:45:03 +0100 |
commit | 1c0b7ed6f922da81ecd05e279ee268c60706d68d (patch) | |
tree | 9d2fb94bc5f6773ea57d6fc5797eeca4675fece4 | |
parent | 61cb4ef879d662d14eca0e5de4cf6b555bd20c75 (diff) | |
download | chef-ssd-sr/re-raise-system-exit-playground.tar.gz |
debugging failing testssd-sr/re-raise-system-exit-playground
Signed-off-by: Stephan Renatus <srenatus@chef.io>
-rw-r--r-- | spec/unit/runner_spec.rb | 14 |
1 files 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 |