summaryrefslogtreecommitdiff
path: root/test/rss/test_taxonomy.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-02 23:16:36 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-02 23:16:36 +0000
commit2024133681cd0098404f21ea62529b1985de31fe (patch)
tree9bba2ba8ba77fc56eb232c37318566987448db2a /test/rss/test_taxonomy.rb
parent340a644889fd61f79c8e2d56ee5f18bc6bd44785 (diff)
* test/rss/test_taxonomy.rb, test/rss/test_parser_1.0.rb,
test/rss/test_image.rb, test/rss/rss-testcase.rb: ensured declaring XML namespaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@14091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/test_taxonomy.rb')
-rw-r--r--test/rss/test_taxonomy.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/rss/test_taxonomy.rb b/test/rss/test_taxonomy.rb
index 10ae55190a..5109f3d892 100644
--- a/test/rss/test_taxonomy.rb
+++ b/test/rss/test_taxonomy.rb
@@ -144,8 +144,10 @@ EOR
end
@topic_nodes.each_with_index do |node, i|
- expected = REXML::Document.new(node).root
- actual = REXML::Document.new(@rss.taxo_topics[i].to_s(true, "")).root
+ expected_xml = taxo_xmlns_container(node)
+ expected = REXML::Document.new(expected_xml).root.elements[1]
+ actual_xml = taxo_xmlns_container(@rss.taxo_topics[i].to_s(true, ""))
+ actual = REXML::Document.new(actual_xml).root.elements[1]
expected_elems = expected.reject {|x| x.is_a?(REXML::Text)}
actual_elems = actual.reject {|x| x.is_a?(REXML::Text)}
expected_elems.sort! {|x, y| x.name <=> y.name}
@@ -155,6 +157,16 @@ EOR
assert_equal(expected.attributes.sort, actual.attributes.sort)
end
end
+
+ private
+ def taxo_xmlns_container(content)
+ xmlns_container({
+ @prefix => @uri,
+ "dc" => "http://purl.org/dc/elements/1.1/",
+ "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+ },
+ content)
+ end
end
end