Is there a Mocha equivalent of Rspec’s “mock().as_null_object”?
Asked Answered
P

1

11

Is there a Mocha equivalent of Rspec’s “mock().as_null_object”?

Poppy answered 19/12, 2010 at 6:58 Comment(0)
P
16

Yes. Use “stub_everything()”

Documented here: http://mocha.rubyforge.org/classes/Mocha/API.html#M000004.

Poppy answered 19/12, 2010 at 7:5 Comment(1)
stub_everything always returns nil, as_null_object always returns the stub, so they aren't quite the sameSignification

© 2022 - 2024 — McMap. All rights reserved.