class RSpec::Mocks::MethodDouble
def original_method
- Private: -
def original_method if @method_stasher.method_is_stashed? # Example: a singleton method defined on @object ::RSpec::Mocks.method_handle_for(@object, @method_stasher.stashed_method_name) elsif meth = original_unrecorded_any_instance_method # Example: a method that has been mocked through # klass.any_instance.should_receive(:msg).and_call_original # any_instance.should_receive(:msg) causes the method to be # replaced with a proxy method, and then `and_call_original` # is recorded and played back on the object instance. We need # special handling here to get a handle on the original method # object rather than the proxy method. meth else # Example: an instance method defined on one of @object's ancestors. original_method_from_ancestry end rescue NameError # We have no way of knowing if the object's method_missing # will handle this message or not...but we can at least try. # If it's not handled, a `NoMethodError` will be raised, just # like normally. ProcWithBlock.new(@object,@method_name) end