class Mocha::ParameterMatchers::HasEntries

Parameter matcher which matches when actual parameter contains all expected Hash entries.

Public Class Methods

new(entries) click to toggle source

@private

# File lib/mocha/parameter_matchers/has_entries.rb, line 33
def initialize(entries)
  @entries = entries
end

Public Instance Methods

matches?(available_parameters) click to toggle source

@private

# File lib/mocha/parameter_matchers/has_entries.rb, line 38
def matches?(available_parameters)
  parameter = available_parameters.shift
  has_entry_matchers = @entries.map { |key, value| HasEntry.new(key, value) }
  AllOf.new(*has_entry_matchers).matches?([parameter])
end
mocha_inspect() click to toggle source

@private

# File lib/mocha/parameter_matchers/has_entries.rb, line 45
def mocha_inspect
  "has_entries(#{@entries.mocha_inspect})"
end