Is there a Mocha equivalent of Rspec’s “mock().as_null_object”?
Is there a Mocha equivalent of Rspec’s “mock().as_null_object”?
Asked Answered
Yes. Use “stub_everything()”
Documented here: http://mocha.rubyforge.org/classes/Mocha/API.html#M000004.
© 2022 - 2024 — McMap. All rights reserved.
stub_everything
always returns nil,as_null_object
always returns the stub, so they aren't quite the same – Signification