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
- .new(expected_arity, expected_keywords, arbitrary_keywords, unlimited_arguments) ⇒ ArityCheck constructor Internal use only
Instance Method Summary
- #matches?(actual, name) ⇒ Boolean Internal use only
- #method_signature_for(actual, name) Internal use only
- #verifier_for(actual, name) Internal use only
Instance Method Details
#matches?(actual, name) ⇒ Boolean
# 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