A) Update code in ActiveSupport which monkey-patches Test::Unit to
include Mocha bug fix.
A bug was fixed  in Mocha's integration with Test::Unit, but this
monkey-patching code was copied before the fix. We need to copy the
The bug meant that an unexpected invocation against a mock within the
teardown method caused a test *error* and not a test *failure*.
B) Fix for Test::Unit/Mocha compatibility.
Mocha is now using a single AssertionCounter which needs a reference to
the testcase as opposed to the result.
This change is an unfortunate consequence of the copying of a chunk of
Mocha's internal code in order to monkey-patch Test::Unit.
C) Avoid a Mocha deprecation warning.