Class: All

Inherits:
Object
  • Object
show all
Defined in:
lib/itesttool/custom_matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(matcher) ⇒ All

Returns a new instance of All.



92
93
94
# File 'lib/itesttool/custom_matchers.rb', line 92

def initialize(matcher)
  @matcher = matcher
end

Instance Method Details

#failure_message_for_shouldObject



106
107
108
# File 'lib/itesttool/custom_matchers.rb', line 106

def failure_message_for_should
  "at[#{@elem}] #{@matcher.failure_message_for_should}"
end

#matches?(rows) ⇒ Boolean

Returns:

  • (Boolean)


96
97
98
99
100
101
102
103
104
# File 'lib/itesttool/custom_matchers.rb', line 96

def matches?(rows)
  rows.each_with_index do |i, j|
    @elem = j
    unless @matcher.matches? i
      return false
    end
  end
  return true
end