Skip to content

Commit

Permalink
fix(test): explicitly require members in xpath query assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
randym committed Nov 4, 2016
1 parent f4cd23b commit 731639b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/workbook/worksheet/tc_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def test_to_xml_string_with_run
@c.font_name = 'arial'
@c.color = 'FF0000'
c_xml = Nokogiri::XML(@c.to_xml_string(1,1))
assert(c_xml.xpath("//b"))
assert(c_xml.xpath("//b").any?)
end

def test_to_xml_string_formula
Expand All @@ -303,8 +303,8 @@ def test_to_xml_string_formula
sheet.add_row ["=IF(2+2=4,4,5)"]
end
doc = Nokogiri::XML(ws.to_xml_string)
assert(doc.xpath("//f[@text()='IF(2+2=4,4,5)']"))

doc.remove_namespaces!
assert(doc.xpath("//f[text()='IF(2+2=4,4,5)']").any?)
end

def test_to_xml_string_array_formula
Expand All @@ -314,9 +314,9 @@ def test_to_xml_string_array_formula
end
doc = Nokogiri::XML(ws.to_xml_string)
doc.remove_namespaces!
assert(doc.xpath("//f[text()='SUM(C2:C11*D2:D11)']"))
assert(doc.xpath("//f[@t='array']"))
assert(doc.xpath("//f[@ref='A1']"))
assert(doc.xpath("//f[text()='SUM(C2:C11*D2:D11)']").any?)
assert(doc.xpath("//f[@t='array']").any?)
assert(doc.xpath("//f[@ref='A1']").any?)
end

def test_to_xml_string_text_formula
Expand Down

0 comments on commit 731639b

Please sign in to comment.