diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-13 13:13:34 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-03 16:05:17 +0200 |
| commit | 350f7ae9a04f3d39c099cc54f7c04bf31f385d96 (patch) | |
| tree | e84af2a70d3b18a0b94c784338faf48215c9c8a8 /test/workbook/worksheet/tc_worksheet_hyperlink.rb | |
| parent | e81036b76e734ab03fac31faafb9732f6b3b2928 (diff) | |
| download | caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip | |
Add RuboCop Minitest
Diffstat (limited to 'test/workbook/worksheet/tc_worksheet_hyperlink.rb')
| -rw-r--r-- | test/workbook/worksheet/tc_worksheet_hyperlink.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/workbook/worksheet/tc_worksheet_hyperlink.rb b/test/workbook/worksheet/tc_worksheet_hyperlink.rb index 98b6937b..29e302a0 100644 --- a/test/workbook/worksheet/tc_worksheet_hyperlink.rb +++ b/test/workbook/worksheet/tc_worksheet_hyperlink.rb @@ -35,20 +35,22 @@ class TestWorksheetHyperlink < Test::Unit::TestCase def test_to_xml_string_with_non_external doc = Nokogiri::XML(@ws.to_xml_string) - assert_equal(doc.xpath("//xmlns:hyperlink[@ref='#{@a.ref}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@tooltip='#{@a.tooltip}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@location='#{@a.location}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@display='#{@a.display}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@r:id]").size, 0) + + assert_equal(1, doc.xpath("//xmlns:hyperlink[@ref='#{@a.ref}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@tooltip='#{@a.tooltip}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@location='#{@a.location}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@display='#{@a.display}']").size) + assert_equal(0, doc.xpath("//xmlns:hyperlink[@r:id]").size) end def test_to_xml_stirng_with_external @a.target = :external doc = Nokogiri::XML(@ws.to_xml_string) - assert_equal(doc.xpath("//xmlns:hyperlink[@ref='#{@a.ref}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@tooltip='#{@a.tooltip}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@display='#{@a.display}']").size, 1) - assert_equal(doc.xpath("//xmlns:hyperlink[@location='#{@a.location}']").size, 0) - assert_equal(doc.xpath("//xmlns:hyperlink[@r:id='#{@a.relationship.Id}']").size, 1) + + assert_equal(1, doc.xpath("//xmlns:hyperlink[@ref='#{@a.ref}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@tooltip='#{@a.tooltip}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@display='#{@a.display}']").size) + assert_equal(0, doc.xpath("//xmlns:hyperlink[@location='#{@a.location}']").size) + assert_equal(1, doc.xpath("//xmlns:hyperlink[@r:id='#{@a.relationship.Id}']").size) end end |
