[rspec-users] Stubbing out method for all instances
david.smalley.lists at googlemail.com
Tue Mar 27 06:34:55 EDT 2007
On 27 Mar 2007, at 11:19, aslak hellesoy wrote:
> What's Test::Unit mocks?
Ah sorry, by which I mean the /test/mocks/<env>/mocked_code.rb
setup in a default Rails skeleton - it lets you drop a replacement
for a method that appears higher up in the search path and allows you
to completely over-ride a method.
>> and just replace the encoded? instance method for all objects that
>> might use it to just return true.
>> Any ideas?
> You can submit a feature request - ideally with a failing spec to
> illustrate what you want.
After a bit of digging around it looks like David (Chelimsky) has
already submitted such a feature request
func=detail&aid=6791&group_id=797&atid=3152 - looks a lot like what I
Consider it similar to the syntax offered by mocha
I think it would be a very helpful addition to Rspec stub/mock
framework - I'd be interested in helping to implement it but I fear I
don't know enough about how mocking works. I'll dig into mocha and
rspec code but if any of the Rspec developers want to take the lead
that would be great!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users