Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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
Mike Gunderloy ffmike authored spastorino committed
4 activesupport/lib/active_support/testing/setup_and_teardown.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.