Skip to content

Commit

Permalink
Copy Mocha bug fix.
Browse files Browse the repository at this point in the history
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]
freerange/mocha@f1ff647#diff-5
  • Loading branch information
floehopper committed Nov 13, 2012
1 parent 6189232 commit 716bdfc
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def run(result)
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
Expand Down

0 comments on commit 716bdfc

Please sign in to comment.