[mocha-developer] using mocha with rspec

James Mead jamesmead44 at gmail.com
Tue Mar 13 07:53:44 EDT 2007

On 13/03/07, Dan North <dan at tastapod.com> wrote:
> Yes you're right - it doesn't automagically verify, but the verify_mocks
> method is in scope and I like to have that explicitly in my spec methods
> anyway.

Actually I was thinking of the poorly named "verify_stubs" (as opposed to
"verify_mocks") and "teardown_stubs" methods in Mocha::SetupAndTeardown.

These are to do with the "partial mocking" I mentioned in my previous email.
But perhaps you aren't using that aspect of Mocha.

If you do something like this...

now = Time.parse('2006-01-01 00:00:00')

Unless you call the methods in Mocha::SetupAndTeardown, "Time.now" will
continue to return the fixed value "now" after the test has finished.


More information about the mocha-developer mailing list