summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_worksheet_hyperlink.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/workbook/worksheet/tc_worksheet_hyperlink.rb')
-rw-r--r--test/workbook/worksheet/tc_worksheet_hyperlink.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/workbook/worksheet/tc_worksheet_hyperlink.rb b/test/workbook/worksheet/tc_worksheet_hyperlink.rb
index 98b6937b..82f6689b 100644
--- a/test/workbook/worksheet/tc_worksheet_hyperlink.rb
+++ b/test/workbook/worksheet/tc_worksheet_hyperlink.rb
@@ -1,4 +1,4 @@
-require 'tc_helper.rb'
+require 'tc_helper'
class TestWorksheetHyperlink < Test::Unit::TestCase
def setup
@@ -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