class IncludeWith

Public Class Methods

new(key, values) click to toggle source
# File lib/itesttool/custom_matchers.rb, line 147
def initialize(key, values)
  @key = key
  @values = values
end

Public Instance Methods

failure_message_for_should() click to toggle source
# File lib/itesttool/custom_matchers.rb, line 157
def failure_message_for_should
  str = @values.map{|x| "#{@key} => #{x}"}.join(" and ")
  "expected #{@rows.inspect} to include #{str}"
end
matches?(rows) click to toggle source
# File lib/itesttool/custom_matchers.rb, line 151
def matches?(rows)
  @rows = rows
  list = rows.map{|x| x[@key]}
  Set[*list] == Set[*@values]
end

Private Instance Methods

msg_of_type_invalid() click to toggle source
# File lib/itesttool/custom_matchers.rb, line 163
def msg_of_type_invalid
  str = @values.map{|x| "#{@key} => #{x}"}.join(" and ")
  "expected not #{@rows.inspect} to include #{str}"
end