class RSpec::Mocks::VerifyingMethodDouble

@private

def add_expectation(*args, &block)

def add_expectation(*args, &block)
  # explicit params necessary for 1.8.7 see #626
  super(*args, &block).tap { |x| x.method_reference = @method_reference }
end

def add_stub(*args, &block)

def add_stub(*args, &block)
  # explicit params necessary for 1.8.7 see #626
  super(*args, &block).tap { |x| x.method_reference = @method_reference }
end

def initialize(object, method_name, proxy, method_reference)

def initialize(object, method_name, proxy, method_reference)
  super(object, method_name, proxy)
  @method_reference = method_reference
end

def message_expectation_class

def message_expectation_class
  VerifyingMessageExpectation
end

def proxy_method_invoked(obj, *args, &block)

def proxy_method_invoked(obj, *args, &block)
  validate_arguments!(args)
  super
end

def validate_arguments!(actual_args)

def validate_arguments!(actual_args)
  @method_reference.with_signature do |signature|
    verifier = Support::StrictSignatureVerifier.new(signature, actual_args)
    raise ArgumentError, verifier.error_message unless verifier.valid?
  end
end