Class: Spec::Mocks::ArgumentMatchers::DuckTypeMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/plugins/rspec/lib/spec/mocks/argument_matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(*methods_to_respond_to) ⇒ DuckTypeMatcher

Returns a new instance of DuckTypeMatcher.



96
97
98
# File 'lib/vendor/plugins/rspec/lib/spec/mocks/argument_matchers.rb', line 96

def initialize(*methods_to_respond_to)
  @methods_to_respond_to = methods_to_respond_to
end

Instance Method Details

#==(value) ⇒ Object



100
101
102
# File 'lib/vendor/plugins/rspec/lib/spec/mocks/argument_matchers.rb', line 100

def ==(value)
  @methods_to_respond_to.all? { |sym| value.respond_to?(sym) }
end