I am upgrading from rspec 2 to rspec 3 and would like to use the new syntax and not enable the old syntax. But I have a few stubs that I set up in my top-level before(:each)
block that I selectively unstub
where I want the original implementation.
Is there some equivalent way to remove a stub when I've defined it with the new allow
syntax?
You could redifine them with
expect(Person).to receive(:find).and_call_original
which will additionaly check that the original :find method was called on person
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With