diff options
| author | randym <[email protected]> | 2016-11-04 12:32:58 +0900 |
|---|---|---|
| committer | randym <[email protected]> | 2016-11-04 12:32:58 +0900 |
| commit | 731639b7d8871e79e96167b64c83f55e06bf78f6 (patch) | |
| tree | 8cfe7d371e16e10befffd5dc6b2d43afc153d81b | |
| parent | f4cd23bb5ca019936ff710d32bb0b69fc0f44db0 (diff) | |
| download | caxlsx-731639b7d8871e79e96167b64c83f55e06bf78f6.tar.gz caxlsx-731639b7d8871e79e96167b64c83f55e06bf78f6.zip | |
fix(test): explicitly require members in xpath query assertion
| -rw-r--r-- | test/workbook/worksheet/tc_cell.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index 428e55a5..f61a254f 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -294,7 +294,7 @@ class TestCell < Test::Unit::TestCase @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 @@ -303,8 +303,8 @@ class TestCell < Test::Unit::TestCase 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 @@ -314,9 +314,9 @@ class TestCell < Test::Unit::TestCase 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 |
