123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Matchers::BuiltIn::RespondTo::ArityCheck Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-expectations/lib/rspec/matchers/built_in/respond_to.rb

Class Method Summary

Instance Method Summary

Instance Method Details

#matches?(actual, name) ⇒ Boolean

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/respond_to.rb', line 178

def matches?(actual, name)
  return true if @expectation.empty?
  verifier_for(actual, name).with_expectation(@expectation).valid?
end

#method_signature_for(actual, name)

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/respond_to.rb', line 187

def method_signature_for(actual, name)
  method_handle = Support.method_handle_for(actual, name)

  if name == :new && method_handle.owner === ::Class && ::Class === actual
    Support::MethodSignature.new(actual.instance_method(:initialize))
  else
    Support::MethodSignature.new(method_handle)
  end
end

#verifier_for(actual, name)

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/matchers/built_in/respond_to.rb', line 183

def verifier_for(actual, name)
  Support::StrictSignatureVerifier.new(method_signature_for(actual, name))
end