class Mocha::ParameterMatchers::Includes
def matches?(available_parameters)
- Private: -
def matches?(available_parameters) parameter = available_parameters.shift return false unless parameter.respond_to?(:include?) if @items.size == 1 # rubocop:disable Style/GuardClause if parameter.respond_to?(:any?) && !parameter.is_a?(String) parameter = parameter.keys if parameter.is_a?(Hash) return parameter.any? { |p| @items.first.to_matcher.matches?([p]) } else return parameter.include?(@items.first) end # rubocop:enable Style/GuardClause else includes_matchers = @items.map { |item| Includes.new(item) } AllOf.new(*includes_matchers).matches?([parameter]) end end