Is there a Mocha equivalent of Rspec’s “mock().as_null_object”?
Asked
Active
Viewed 1,278 times
1 Answers
16
Yes. Use “stub_everything()”
Documented here: http://mocha.rubyforge.org/classes/Mocha/API.html#M000004.
-
4`stub_everything` always returns nil, `as_null_object` always returns the stub, so they aren't quite the same – Jim Deville Nov 01 '12 at 21:33