Skip to content

Commit

Permalink
fix for rspec 2.99
Browse files Browse the repository at this point in the history
2.99 renames RSpec::Mocks::Mock to RSpec::Mocks::Double.  This change
uses a real exception class and avoids mocking it so that we aren't
brittle against rspec's own class namespace.
  • Loading branch information
lamont-granquist committed Jun 3, 2014
1 parent 7588211 commit 7c554ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/unit/resource_reporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
@backtrace = ["foo.rb:1 in `foo!'","bar.rb:2 in `bar!","'baz.rb:3 in `baz!'"]
@node = Chef::Node.new
@node.name("spitfire")
@exception = double("ArgumentError")
@exception = ArgumentError.new
@exception.stub(:inspect).and_return("Net::HTTPServerException")
@exception.stub(:message).and_return("Object not found")
@exception.stub(:backtrace).and_return(@backtrace)
Expand All @@ -463,7 +463,7 @@

it "includes the error inspector output in the event data" do
@report["data"]["exception"].should have_key("description")
@report["data"]["exception"]["description"].should include({"title"=>"Error expanding the run_list:", "sections"=>[{"Unexpected Error:" => "RSpec::Mocks::Mock: Object not found"}]})
@report["data"]["exception"]["description"].should include({"title"=>"Error expanding the run_list:", "sections"=>[{"Unexpected Error:" => "ArgumentError: Object not found"}]})
end

end
Expand Down

0 comments on commit 7c554ab

Please sign in to comment.