[mocha-developer] Terse Mocks

Dan North dan at tastapod.com
Thu May 3 06:26:11 EDT 2007


Brian Takita wrote:
>> You can also have a "Recorder" type object that implements method_missing
>> and instance eval the block. That way, you can avoid having to pass in the
>> reference to the mock '|m|'.
>>     
Yes, you can have the object just yield to the block, but it looks less 
intuitive to me, because I have to think about what the value of "self" 
is for find('3') or destroy(7). The parameter makes it explicit that 
it's on the mock. That's the only reason I went with one rather than the 
other.

Cheers,
Dan


More information about the mocha-developer mailing list