a1c88dd
# Nokogiri is choking on assertions that use nth-child with a loose parent match
a1c88dd
diff --git a/test/tables_test.rb b/test/tables_test.rb
a1c88dd
index 5ccb92e..d86a70d 100644
a1c88dd
--- a/test/tables_test.rb
a1c88dd
+++ b/test/tables_test.rb
a1c88dd
@@ -21,8 +21,8 @@ context 'Tables' do
a1c88dd
       assert_css 'table td', output, 9
a1c88dd
       assert_css 'table > tbody > tr > td.tableblock.halign-left.valign-top > p.tableblock', output, 9
a1c88dd
       cells.each_with_index {|row, rowi|
a1c88dd
-        assert_css "table tr:nth-child(#{rowi + 1}) > td", output, row.size
a1c88dd
-        assert_css "table tr:nth-child(#{rowi + 1}) > td > p", output, row.size
a1c88dd
+        assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td", output, row.size
a1c88dd
+        assert_css "table > tbody > tr:nth-child(#{rowi + 1}) > td > p", output, row.size
a1c88dd
         row.each_with_index {|cell, celli|
a1c88dd
           assert_xpath "(//tr)[#{rowi + 1}]/td[#{celli + 1}]/p[text()='#{cell}']", output, 1
a1c88dd
         }
a1c88dd
@@ -272,21 +272,21 @@ d|9 2+>|10
a1c88dd
       assert_css 'table > tbody > tr:nth-child(3) > td', output, 1
a1c88dd
       assert_css 'table > tbody > tr:nth-child(4) > td', output, 2
a1c88dd
       
a1c88dd
-      assert_css 'table tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0
a1c88dd
-      assert_css 'table tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(1).halign-left.valign-top p em', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(2).halign-right.valign-top p strong', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(3).halign-center.valign-top p *', output, 0
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(1) > td:nth-child(4).halign-right.valign-top p strong', output, 1
a1c88dd
 
a1c88dd
-      assert_css 'table tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(1).halign-center.valign-top p em', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(2).halign-center.valign-middle[colspan="2"][rowspan="2"] p tt', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(2) > td:nth-child(3).halign-left.valign-bottom[rowspan="3"] p tt', output, 1
a1c88dd
 
a1c88dd
-      assert_css 'table tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(3) > td:nth-child(1).halign-center.valign-top p em', output, 1
a1c88dd
 
a1c88dd
-      assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1
a1c88dd
-      assert_css 'table tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0
a1c88dd
-      assert_css 'table tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p', output, 1
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(1).halign-left.valign-top p em', output, 0
a1c88dd
+      assert_css 'table > tbody > tr:nth-child(4) > td:nth-child(2).halign-right.valign-top[colspan="2"] p tt', output, 1
a1c88dd
     end
a1c88dd
 
a1c88dd
     test 'supports repeating cells' do