Browse files

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*.

  • Loading branch information...
1 parent 6189232 commit 716bdfc01d45a61d211dbd766f494cb984fc9f9c @floehopper floehopper committed Aug 26, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -83,6 +83,8 @@ def run(result)
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

0 comments on commit 716bdfc

Please sign in to comment.