jnicklas/xpath — Issue #32: XPath::HTML.table is broken
Author: teamon
Created: 2011-11-10 15:59:34+00:00
State: open

Does not work if there are thead / tbody tags (first row is matched, but then because of tbody nothing is matched correctly)

Also, I thinks it should use 'contains' instead of 'string.n.equal()' (It is impossible to match a table cell with link inside)

Fixed table_row method:

def table_row(cells)
# Changed
# string.n.equals(str)
# into
# contains(str)
#
# to make have_table matcher less strict

cell_conditions = child(:td, :th)[contains(cells.first)]
cells.drop(1).each do |cell|
cell_conditions = cell_conditions.next_sibling(:td, :th)[contains(cell)]
end
cell_conditions
end