123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Mocks::VerifyingExistingMethodDouble Private

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

Overview

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.

Constant Summary

MethodDouble - Inherited

FROZEN_ERROR_MSG, RSpecPrependedModule

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Class Method Details

.for(object, method_name, proxy)

[ GitHub ]

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

def self.for(object, method_name, proxy)
  if ClassNewMethodReference.applies_to?(method_name) { object }
    VerifyingExistingClassNewMethodDouble
  elsif Mocks.configuration.temporarily_suppress_partial_double_verification
    MethodDouble
  else
    self
  end.new(object, method_name, proxy)
end

Instance Attribute Details

#unimplemented?Boolean (readonly)

[ GitHub ]

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

def unimplemented?
  !@valid_method
end

Instance Method Details

#with_signature {|Support::MethodSignature.new(original_implementation_callable)| ... }

Yields:

[ GitHub ]

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

def with_signature
  yield Support::MethodSignature.new(original_implementation_callable)
end