class RSpec::Mocks::ArgumentMatchers::DuckTypeMatcher

@private

Public Class Methods

new(*methods_to_respond_to) click to toggle source
# File lib/rspec/mocks/argument_matchers.rb, line 261
def initialize(*methods_to_respond_to)
  @methods_to_respond_to = methods_to_respond_to
end

Public Instance Methods

===(value) click to toggle source
# File lib/rspec/mocks/argument_matchers.rb, line 265
def ===(value)
  @methods_to_respond_to.all? { |message| value.respond_to?(message) }
end
description() click to toggle source
# File lib/rspec/mocks/argument_matchers.rb, line 269
def description
  "duck_type(#{@methods_to_respond_to.map(&:inspect).join(', ')})"
end