summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Shpakov <igorshp@gmail.com>2015-04-20 14:05:26 +0100
committerIgor Shpakov <igorshp@gmail.com>2015-04-20 14:05:26 +0100
commit876597fa6cc1014873482b8f56fdcf39c633bc26 (patch)
tree3d2d12b55ba2d325c7a8c1e308f0572cf86943d2
parent95f006606ae73551621a57987f2336145f6dc50f (diff)
downloadchef-876597fa6cc1014873482b8f56fdcf39c633bc26.tar.gz
revised rspec test
-rw-r--r--spec/unit/client_spec.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index dd8132d69c..7146e69222 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -821,22 +821,19 @@ describe Chef::Client do
end
describe "always attempt to run handlers" do
- let(:e) { NoMethodError }
subject { client }
before do
# fail on the first thing in begin block
- allow_any_instance_of(Chef::RunLock).to receive(:save_pid).and_raise(e)
+ allow_any_instance_of(Chef::RunLock).to receive(:save_pid).and_raise(NoMethodError)
end
it "should run exception handlers on early fail" do
expect(subject).to receive(:run_failed)
- exception = nil
- begin
- subject.run
- rescue e => ex
- exception = ex
- end
- expect(exception).to be_instance_of(e)
+ begin
+ subject.run
+ rescue => exception
+ expect(exception).to be_instance_of(NoMethodError)
+ end
end
end
end