123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Mocks::VerifyingMethodDouble Private

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
RSpec::Mocks::VerifyingExistingClassNewMethodDouble, RSpec::Mocks::VerifyingExistingMethodDouble
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, MethodDouble
Instance Chain:
self, MethodDouble
Inherits: RSpec::Mocks::MethodDouble
Defined in: rspec-mocks/lib/rspec/mocks/verifying_proxy.rb

Constant Summary

MethodDouble - Inherited

FROZEN_ERROR_MSG, RSpecPrependedModule

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Method Details

#add_expectation(*args, &block)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 149

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

#add_stub(*args, &block)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 154

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

#message_expectation_class

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 145

def message_expectation_class
  VerifyingMessageExpectation
end

#proxy_method_invoked(obj, *args, &block)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 159

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

#validate_arguments!(actual_args)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/verifying_proxy.rb', line 165

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