You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one is a little tricky. Currently, the mock expectation is on an instance basis. User.new is stubbed, with no times called expectation. If User.new is invoked, the returned User has the expectation that explode will be called once.
Since spies were implemented, RR keeps track of the method calls. We could treat this more like User#explode must be invoked once globally.
I will be adding mock.all_instances_of (currently it's in master but not yet released), which will override the User class, removing the dependence on User.new. It could totally work in that case.
mock.instance_of(User).explode
the spec passes even if User#explode is never invoked
The text was updated successfully, but these errors were encountered: