lib/rspec/power_assert.rb in rspec-power_assert-0.0.1 vs lib/rspec/power_assert.rb in rspec-power_assert-0.0.2
- old
+ new
@@ -11,11 +11,16 @@
result = tp.yield
msg = tp.message_proc.call
end
if result
- RSpec::Matchers.last_expectation_handler = DummyExpectationHandler
RSpec::Matchers.last_matcher = DummyAssertionMatcher.new(msg)
+
+ if RSpec::Matchers.respond_to?(:last_should=)
+ RSpec::Matchers.last_should = "" # for RSpec 2
+ else
+ RSpec::Matchers.last_expectation_handler = DummyExpectationHandler # for RSpec 3
+ end
else
raise RSpec::Expectations::ExpectationNotMetError, msg
end
end