[rspec-users] Stubbing all methods

Courtenay court3nay at gmail.com
Tue Aug 14 19:09:53 EDT 2007

On 8/14/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> On 8/15/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> >
> > Mocha's mock/stub framework has the ability to stub all methods on a
> > mock given.  Does RSpec's mocking framework have this ability?

You mean like :null_object => true ??



"As above, but allows you to specific options to tweak the mock's
behaviour. The options argument is a hash. Currently the only
supported option is :null_object. Setting this to true instructs the
mock to ignore (quietly consume) any messages it hasn't been told to
expect – and return itself. i.e.

my_mock = mock("blah", :null_object => true)

More information about the rspec-users mailing list