I have something like:
value = nil if some_condition value =my_object.do_stuff() end
And in my test, I have the follwing:
My
There is and_call_original method:
and_call_original
MyObject.any_instance.should_receive(:do_stuff).and_call_original
See https://github.com/rspec/rspec-mocks#delegating-to-the-original-implementation