aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJames Mead <james@floehopper.org>2012-08-26 16:32:47 +0100
committerJames Mead <james@floehopper.org>2012-11-13 08:25:14 +0000
commit716bdfc01d45a61d211dbd766f494cb984fc9f9c (patch)
treeeabc1479a4701e253ad771ae04ed5e750bb85468 /activesupport
parent618923280048928aff50eed4fe9a9b08f9ebad72 (diff)
downloadrails-716bdfc01d45a61d211dbd766f494cb984fc9f9c.tar.gz
rails-716bdfc01d45a61d211dbd766f494cb984fc9f9c.tar.bz2
rails-716bdfc01d45a61d211dbd766f494cb984fc9f9c.zip
Copy Mocha bug fix.
A bug was fixed [1] in Mocha's integration with Test::Unit, but this monkey-patching code was copied before the fix. We need to copy the fixed version. The bug meant that an unexpected invocation against a mock within the teardown method caused a test *error* and not a test *failure*. [1] https://github.com/freerange/mocha/commit/f1ff6475ca2871f2977ab84cabbbfe2adadbbee6#diff-5
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/setup_and_teardown.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/testing/setup_and_teardown.rb b/activesupport/lib/active_support/testing/setup_and_teardown.rb
index f2268d1767..0a78442f17 100644
--- a/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -83,6 +83,8 @@ module ActiveSupport
begin
teardown
run_callbacks :teardown
+ rescue Mocha::ExpectationError => e
+ add_failure(e.message, e.backtrace)
rescue Test::Unit::AssertionFailedError => e
add_failure(e.message, e.backtrace)
rescue Exception => e