class RSpec::Mocks::VerifyingExistingMethodDouble

A VerifyingMethodDouble fetches the method to verify against from the original object, using a MethodReference. This works for pure doubles, but when the original object is itself the one being modified we need to collapse the reference and the method double into a single object so that we can access the original pristine method definition.

@private

Public Class Methods

new(object, method_name, proxy) click to toggle source
Calls superclass method RSpec::Mocks::VerifyingMethodDouble.new
# File lib/rspec/mocks/verifying_proxy.rb, line 154
def initialize(object, method_name, proxy)
  super(object, method_name, proxy, self)

  @valid_method = object.respond_to?(method_name, true)

  # Trigger an eager find of the original method since if we find it any
  # later we end up getting a stubbed method with incorrect arity.
  save_original_method!
end

Public Instance Methods

unimplemented?() click to toggle source
# File lib/rspec/mocks/verifying_proxy.rb, line 168
def unimplemented?
  !@valid_method
end
with_signature() { |method_signature| ... } click to toggle source
# File lib/rspec/mocks/verifying_proxy.rb, line 164
def with_signature
  yield Support::MethodSignature.new(original_method)
end