Class: ViewMatchers::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/view_matchers/table_matcher/table.rb

Direct Known Subclasses

ASCIITable, HTMLTable

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ Table

Returns a new instance of Table.



3
4
5
6
# File 'lib/view_matchers/table_matcher/table.rb', line 3

def initialize(table)
  @table = table
  self
end

Instance Method Details

#contains?(table) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
# File 'lib/view_matchers/table_matcher/table.rb', line 8

def contains?(table)
  possible_origins_of(table).each do |origin|
    matches = continuous_row_matches_from_index table, origin
    return true if matches.all? && matches.uniq.length == 1
  end
  false
end