[mocha-developer] Mocha 0.4 released

James Mead jamesmead44 at gmail.com
Wed Jan 24 05:48:16 EST 2007

So I finally got round to releasing a new
Mocha <http://mocha.rubyforge.org/>. Much of the functionality has been
available for some time if you've been using the Rails plugin based on
subversion HEAD, but now you can get it in all in a gem (or other package).
The most recent changes centre around allowing mocking of Object instance

Release notes…

   - Allow naming of mocks (patch from Chris Roos<http://blog.seagul.co.uk/>
   - Specify multiple return values for consecutive calls.
   - Improved consistency of expectation error messages.
   - Allow mocking of Object instance methods e.g. kind_of?, type.
   - Provide aliased versions of #expects and #stubs to allow mocking of
   these methods.
   - Added at_least, at_most, at_most_once methods to expectation.
   - Allow expects and stubs to take a hash of method and return values.
   - Eliminate warning: "instance variable @yield not initialized" (patch
   from Xavier Shay <http://blog.rhnh.net/>).
   - Restore instance methods on partial mocks (patch from Chris
   - Allow stubbing of a method with non-word chars in its name (patch
   from Paul Battley <http://po-ru.com/>).
   - Removed coupling to
   - Allow specified exception instance to be raised (patch from Chris
   Roos <http://blog.seagul.co.uk/>).
   - Make mock object_id appear in hex like normal Ruby inspect (patch
   from Paul Battley <http://po-ru.com/>).
   - Fix path to object.rb in rdoc rake task (patch from Tomas
   - Reverse order in which expectations are matched, so that last
   expectation is matched first. This allows e.g. a call to #stubs to be
   effectively overridden by a call to #expects (patch from Tobias
   - Stubba & SmartTestCase modules incorporated into Mocha module so
   only need to require 'mocha' – no longer need to require 'stubba'.
   - AutoMocha removed.

Thanks to all who contributed.

Enjoy :-)
I've created a mocha_release category on my blog, so if you want
notification of new releases you can subscribe to


More information about the mocha-developer mailing list