class Mocha::ParameterMatchers::AnyOf
Parameter matcher which combines a number of other matchers using a logical OR.
Public Class Methods
new(*matchers)
click to toggle source
@private
# File lib/mocha/parameter_matchers/any_of.rb, line 36 def initialize(*matchers) @matchers = matchers end
Public Instance Methods
matches?(available_parameters)
click to toggle source
@private
# File lib/mocha/parameter_matchers/any_of.rb, line 41 def matches?(available_parameters) parameter = available_parameters.shift @matchers.any? { |matcher| matcher.to_matcher.matches?([parameter]) } end
mocha_inspect()
click to toggle source
@private
# File lib/mocha/parameter_matchers/any_of.rb, line 47 def mocha_inspect "any_of(#{@matchers.map(&:mocha_inspect).join(', ')})" end