Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix ActiveSupport integration with Mocha > 0.12.1

Mocha 0.12.2 renames the Integration module to
MonkeyPatching. This breaks the code Rails uses
to retrieve the assertion counter from Mocha.
  • Loading branch information...
commit 5c42889e3b37a4f161dde548b204b47a06d7c97c 1 parent 74cf196
@ffmike ffmike authored spastorino committed
View
4 activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -104,8 +104,10 @@ def retrieve_mocha_counter(result) #:nodoc:
if respond_to?(:mocha_verify) # using mocha
if defined?(Mocha::TestCaseAdapter::AssertionCounter)
Mocha::TestCaseAdapter::AssertionCounter.new(result)
- else
+ elsif defined?(Mocha::Integration::TestUnit::AssertionCounter)
Mocha::Integration::TestUnit::AssertionCounter.new(result)
+ else
+ Mocha::MonkeyPatching::TestUnit::AssertionCounter.new(result)
end
end
end

0 comments on commit 5c42889

Please sign in to comment.
Something went wrong with that request. Please try again.