[Rspec-users] do we need stubbing?

aslak hellesoy aslak.hellesoy at gmail.com
Wed Oct 4 13:09:14 EDT 2006

On 10/4/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> Hey all -
> The trunk currently supports three types of mocking/stubbing:
> Mock Objects (created dynamically at runtime)
> Partial Mocking of methods on existing classes
> Stubbing of methods on existing objects or classes
> The main difference between Partial Mocking and Stubbing is that Stubs
> don't verify.
> I'm wondering if we really need the stubbing facility at all, given
> that we can do the same thing using Partial Mocks. If we decided to
> yank the Stubs, we could add Partial Mocks support to objects (right
> now it only works on classes).

Sounds good to me.

Just to be precise - one or more methods could be mocked on an
individual *Object* (Class is an Object). So this would work for any
Object, not just Class. Right?

I don't see a lot of value in stubbing without verification if partial
mocking (or should we call it "object method mocking" to be more
precise?) can be used on *any* object.

> Note that this functionality is not part of a release yet, so any such
> changes would only affect the brave trunk-dwellers among you.
> Any thoughts on this? Can anyone explain to me why stubs are useful in
> addition to partial mocks?

I can't think of a compelling reason.


> David
> _______________________________________________
> Rspec-users mailing list
> Rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the Rspec-users mailing list