@api private Provides the implementation for `respond_to`. Not intended to be instantiated directly.
@api public No-op. Intended to be used as syntactic sugar when using `with`.
@example
expect(obj).to respond_to(:message).with(3).arguments
# File lib/rspec/matchers/built_in/respond_to.rb, line 32 def argument self end
@api private @return [String]
# File lib/rspec/matchers/built_in/respond_to.rb, line 61 def description "respond to #{pp_names}#{with_arity}" end
@private
# File lib/rspec/matchers/built_in/respond_to.rb, line 43 def does_not_match?(actual) find_failing_method_names(actual, :select).empty? end
@api private @return [String]
# File lib/rspec/matchers/built_in/respond_to.rb, line 49 def failure_message "expected #{@actual.inspect} to respond to #{@failing_method_names.map { |name| name.inspect }.join(', ')}#{with_arity}" end
@api private @return [String]
# File lib/rspec/matchers/built_in/respond_to.rb, line 55 def failure_message_when_negated failure_message.sub(/to respond to/, 'not to respond to') end
@private
# File lib/rspec/matchers/built_in/respond_to.rb, line 38 def matches?(actual) find_failing_method_names(actual, :reject).empty? end
Generated with the Darkfish Rdoc Generator 2.