From a252436d64aa5d1f971e5d57b6ec177a207796e8 Mon Sep 17 00:00:00 2001 From: Mike Gunderloy Date: Thu, 2 Aug 2012 06:43:47 -0500 Subject: 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. --- activesupport/lib/active_support/testing/setup_and_teardown.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/testing') diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb index 78d914f8cf..f2268d1767 100644 --- a/activesupport/lib/active_support/testing/setup_and_teardown.rb +++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb @@ -104,8 +104,10 @@ module ActiveSupport 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 -- cgit v1.2.3