summaryrefslogtreecommitdiff
path: root/test/rss/test_image.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_image.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_image.rb')
-rw-r--r--test/rss/test_image.rb27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/rss/test_image.rb b/test/rss/test_image.rb
index 241fdafb7d..381bcf0465 100644
--- a/test/rss/test_image.rb
+++ b/test/rss/test_image.rb
@@ -163,19 +163,23 @@ EOR
def test_favicon_to_s
favicon = @rss.channel.image_favicon
- expected = REXML::Document.new(make_element("#{@prefix}:favicon",
- @favicon_attrs,
- @favicon_contents))
- actual = REXML::Document.new(favicon.to_s(false, ""))
+ expected_xml = image_xmlns_container(make_element("#{@prefix}:favicon",
+ @favicon_attrs,
+ @favicon_contents))
+ expected = REXML::Document.new(expected_xml)
+ actual_xml = image_xmlns_container(favicon.to_s(false, ""))
+ actual = REXML::Document.new(actual_xml)
assert_equal(expected.to_s, actual.to_s)
end
def test_item_to_s
@rss.items.each_with_index do |item, i|
attrs, contents = @items[i]
- expected_s = make_element("#{@prefix}:item", attrs, contents)
- expected = REXML::Document.new(expected_s)
- actual = REXML::Document.new(item.image_item.to_s(false, ""))
+ expected_xml = make_element("#{@prefix}:item", attrs, contents)
+ expected_xml = image_xmlns_container(expected_xml)
+ expected = REXML::Document.new(expected_xml)
+ actual_xml = image_xmlns_container(item.image_item.to_s(false, ""))
+ actual = REXML::Document.new(actual_xml)
assert_equal(expected[0].attributes, actual[0].attributes)
@@ -187,5 +191,14 @@ EOR
end
end
+ private
+ def image_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