[rspec-devel] stubbing/partial mocking
dchelimsky at gmail.com
Tue Oct 3 20:30:11 EDT 2006
Brian Takita has been contributing to a stubs branch to support
stubbing and partial mocking on Modules (and therefore classes). I
tweaked the syntax a bit and merged it into the trunk, so you can
update from the trunk and check out the new stubbing/mocking love. If
you prefer to wait for a release, there should be one coming soon-ish
(I'm aiming for later this week).
As Brian pointed out in an earlier email, partial mocking is generally
somewhat of a last resort, but it is very useful in some cases - like
spec'ing rails controllers that interact with rails model classes:
#stubbing - when you don't care about verification
#partial mocking: when you do care about verification
This is not yet documented on the website - that will be happening
over the next few days.
Also, this does not preclude our slightly longer term goal of
supporting the integration of other mocking/stubbing frameworks. That
is in the works as well.
Enjoy! And thanks to Brian for the excellent contributions.
More information about the rspec-devel