- Avoid loading bits of the test-unit gem by accident. This is an attempt at a fix for the problem that James Adam reported. By using
requireto detect the version of
Test::Unit, we can avoid
rubygemstrying to load bits of the test-unit gem when it’s not wanted.
- Fix exception when running
rakewithout test-unit gem. When test-unit gem >=v2.0.0 was installed but the
MOCHA_OPTIONSwas not specified, a “comparison of
Hashfailed” exception was being raised when running the performance tests. This was because bits of the test-unit gem were being loaded accidentally and a Hash was being incorrectly supplied to the
- Explicitly require
rubygemsfor running tests via
rakeusing test-unit gem.
- Handle newer versions of test-unit gem (v2.0.2 to v2.0.9)
- Handle newer versions of minitest gem (v1.4.0 to v1.6.0)
- Added warnings about monkey-patching test-unit and minitest to aid debugging. These are enabled by including
MOCHA_OPTIONSenvironment variable. This is now a comma-separated list, so that we can specify multiple options e.g.
- Eloy Duran made the unit tests run on 1.9.2dev r25249 and also improved some MiniTest
TestResultcode I’d written and got the acceptance tests running on Ruby 1.9 HEAD. There are still 4 failures because for some reason the backtrace line numbers are off by one. And the minitest_test test case does not run when the whole suite is run with MiniTest. These issues still need investigation.
- Fixed some acceptance tests to run in Ruby 1.9.2 – it’s no longer possible to subvert the protection of a method by calling it via Object#send.
test:performancerake task so it runs in Ruby 1.9.2.
- Fix test incorrectly failing under Rubinius v1.0. This test imposed too many constraints. It appears that Object#inspect legitimately calls Object#object_id in Rubinius. But we’re only interested in what
Mocha::ObjectMethods#mocha_inspectcalls. By stubbing
Object#inspectwe can relax the constraints imposed by the test.
- Luke Redpath added new shorthand any_of and all_of composite parameter matchers using & and |. This provides an alternative syntax for expecting any or all matchers to pass, e.g. foo.expects(:bar).with(equals(1) | equals(2)).
- Improved documentation for Expectation#raises. A number of people have suggested an extension to the API to cope with custom exceptions that have extra constructor parameters. However, since the arguments supplied to Expectation#raises are just passed on to Kernel#raise, it’s possible to pass in an instance of an exception. Thus no change to the API is required, but it does seem worthwhile pointing this out in the docs.
- Corrected RDoc example for Expectation#never thanks to Red David.
- Improved RDoc including a change suggested by Rohit Arondekar.
- Updated gemspec as requested by Sam Woodard.