[rspec-devel] Mocking in the past tense

Jay Levitt lists-rspec at shopwatch.org
Mon Nov 20 07:34:42 EST 2006


David Chelimsky wrote:
>>
>> If may_receive is a synonym for stubs, and if a mock can override a stub
>> today, then this may even work already.
> 
> It does. Check out
> http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks
> 
>> But I like the may_receive
>> syntax, since I'm not really stubbing - I'm just building the framework
>> for a mock.
> 
> I think that depends on what your view of a stub is. To me, it's the
> same as what you're describing as may_receive. Read the blog and let
> me know what you think?

You're right.  I was thinking of stubs and mocks as independent objects. 
  But what we're really doing here is stubbing most of an object and 
mocking part of it, and so the current syntax is actually quite 
descriptive.  Thanks for the blog example; that really clarified things 
for me, and it oughta make its way into the doc somehow.

Jay
> 
>> Jay
>>
>> _______________________________________________
>> rspec-devel mailing list
>> rspec-devel at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-devel
>>
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel



More information about the rspec-devel mailing list