[Rspec-devel] define_instance_method, stub_with, and mock_with

David Astels dastels at daveastels.com
Mon Sep 4 20:10:37 EDT 2006

Hash: SHA1

On 4-Sep-06, at 8:49 PM, David Astels wrote:

> I will be looking hard at mocha/stubba tonight, but they look like a
> good way to go.  I'm quite happy to have us depricate rSpec's mock
> framework in favour of mocha/stubba.

Well.. on first glance Mocha seems significantly inferior to rSpec  
mocks.  No support for consecutive calls, primitive argument  
matching, no ordering, and a rather clunky syntax.

I have an alternative suggestion.  We make the mocking framework  
pluggable.  There are two points on integration to worry about:  
creating a mock and verifying all created mocks.  A single require in  
your spec file to override the builting mocks with mocha would do  
it.  Or something less intrusive... a small mock plugin file that  
rspec requires... install the appropriate one for the mock framework  
of choice.  No reason we couldn't directly support flexmock in this  
way as well.  Then we could extract our mock framework as a  
standalone piece.. a separate project even.  Then anyone could  
install rspec, their mock framework of choice, and the small piece to  
bind them together.


Version: GnuPG v1.4.3 (Darwin)


More information about the Rspec-devel mailing list