[rspec-users] mock weirdness

Nikolay Sturm forum at erisiandiscord.de
Mon Aug 22 10:11:54 EDT 2011

* David Chelimsky [2011-08-22]:
> This means that you need to explicitly stub the load method to do what
> you're trying to do:
>   let(:bar) { mock(Bar, :load => nil).as_null_object }

Thanks for the explanation, David. I wasn't sure whether or not this was
accepted behaviour, I would have expected a null object to be, well, an
object without methods. At least the next guy's google search will point
to the solution. :)



More information about the rspec-users mailing list