class FlexMock::DuckMatcher

Match objects that implement all the methods in methods.

Public Class Methods

new(methods) click to toggle source
# File lib/flexmock/argument_matchers.rb, line 73
def initialize(methods)
  @methods = methods
end

Public Instance Methods

===(target) click to toggle source
# File lib/flexmock/argument_matchers.rb, line 76
def ===(target)
  @methods.all? { |m| target.respond_to?(m) }
end
inspect() click to toggle source
# File lib/flexmock/argument_matchers.rb, line 79
def inspect
  "ducktype(#{@methods.map{|m| m.inspect}.join(',')})"
end