[mocha-developer] Mocks and Manual Tests

Jay Fields jay at jayfields.com
Fri Dec 21 22:08:58 EST 2007

Mocha is great, but what you are looking for is a stub. Mocks verify  
interaction, while stubs simply return canned results.

I'd suggest simply using a stub in the test/mocks/development folder.  
Yes, it's lame that you need to put a development stub in a dir tree  
that has "test" and "mock", but it is what it is. You can also add  
your own folder and explicitly require your mock, but using the Rails  
mechanism should be good enough unless you really can't deal with the  
naming inconsistency.

To be clear, you can use mocha, but I wouldn't bother.

Cheers, Jay

On Dec 8, 2007, at 4:41 PM, <nobrow at eircom.net> <nobrow at eircom.net>  

> Is it possible for me to use Mock objects in manual testing?
> They work great for functional testing, but now I need to load the  
> pages and play around with some stuff, but of course I cant load  
> them because there are a number of classes without implementations,  
> which I want to just mock out.
> Any ideas?
> -----------------------------------------------------------------
> Find the home of your dreams with eircom net property
> Sign up for email alerts now http://www.eircom.net/propertyalerts
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer

More information about the mocha-developer mailing list