summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-03-11 12:50:13 +0900
committerRandy Morgan <[email protected]>2012-03-11 12:50:13 +0900
commit2cc042f2d19d5b7a0846648a97b5a3954d0f25ed (patch)
treec52978d463a2fef4751e868cfdff4dcd7dc0ce45
parent94663f5523112b11ec9bf6a213acf6c838ed60f5 (diff)
downloadcaxlsx-2cc042f2d19d5b7a0846648a97b5a3954d0f25ed.tar.gz
caxlsx-2cc042f2d19d5b7a0846648a97b5a3954d0f25ed.zip
patch specs for nokogiri 1.5.1
-rw-r--r--test/content_type/tc_content_type.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/content_type/tc_content_type.rb b/test/content_type/tc_content_type.rb
index 9fcbcd70..05b3d93c 100644
--- a/test/content_type/tc_content_type.rb
+++ b/test/content_type/tc_content_type.rb
@@ -4,7 +4,7 @@ require 'test/unit'
require 'axlsx.rb'
class TestContentType < Test::Unit::TestCase
- def setup
+ def setup
@package = Axlsx::Package.new
@doc = Nokogiri::XML(@package.send(:content_types).to_xml)
end
@@ -21,31 +21,31 @@ class TestContentType < Test::Unit::TestCase
def test_pre_built_types
- o_path = "Types Override [@ContentType='%s']"
- d_path = "Types Default [@ContentType='%s']"
+ o_path = "//xmlns:Override[@ContentType='%s']"
+ d_path = "//xmlns:Default[@ContentType='%s']"
+
+ #default
+ assert_equal(@doc.xpath("//xmlns:Default").size, 2, "There should be 2 default types")
- #default
- assert_equal(@doc.css("Types Default").size, 2, "There should be 2 default types")
-
- node = @doc.css(d_path % Axlsx::XML_CT).first
+ node = @doc.xpath(d_path % Axlsx::XML_CT).first
assert_equal(node["Extension"], "#{Axlsx::XML_EX}", "xml content type invalid")
- node = @doc.css(d_path % Axlsx::RELS_CT).first
+ node = @doc.xpath(d_path % Axlsx::RELS_CT).first
assert_equal(node["Extension"],"#{Axlsx::RELS_EX}", "relationships content type invalid")
#overrride
- assert_equal(@doc.css("Types Override").size, 4, "There should be 4 Override types")
+ assert_equal(@doc.xpath("//xmlns:Override").size, 4, "There should be 4 Override types")
- node = @doc.css(o_path % Axlsx::APP_CT).first
+ node = @doc.xpath(o_path % Axlsx::APP_CT).first
assert_equal(node["PartName"], "/#{Axlsx::APP_PN}", "App part name invalid")
- node = @doc.css(o_path % Axlsx::CORE_CT).first
+ node = @doc.xpath(o_path % Axlsx::CORE_CT).first
assert_equal(node["PartName"], "/#{Axlsx::CORE_PN}", "Core part name invalid")
- node = @doc.css(o_path % Axlsx::STYLES_CT).first
+ node = @doc.xpath(o_path % Axlsx::STYLES_CT).first
assert_equal(node["PartName"], "/xl/#{Axlsx::STYLES_PN}", "Styles part name invalid")
- node = @doc.css(o_path % Axlsx::WORKBOOK_CT).first
+ node = @doc.xpath(o_path % Axlsx::WORKBOOK_CT).first
assert_equal(node["PartName"], "/#{Axlsx::WORKBOOK_PN}", "Workbook part invalid")
end