summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 09:03:04 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 09:03:04 +0000
commit01fb989358d581904724c7c11fbcd3eaacf5d8ca (patch)
treeb71f7c3dc8b615fbabe8ba12ded9d4be10d0cd52 /test/rss
parent277f48de57ce32717ed6de16c4d96900b237fbf8 (diff)
* lib/rss/maker/feed.rb, test/test_maker_atom_entry.rb,
test/test_maker_atom_feed.rb: fix duplicated dc:date. Reported by Kazuhiro NISHIYAMA. Thanks!!! [ruby-list:46014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/test_maker_atom_entry.rb15
-rw-r--r--test/rss/test_maker_atom_feed.rb14
2 files changed, 29 insertions, 0 deletions
diff --git a/test/rss/test_maker_atom_entry.rb b/test/rss/test_maker_atom_entry.rb
index 09f16f5..c9b9f89 100644
--- a/test/rss/test_maker_atom_entry.rb
+++ b/test/rss/test_maker_atom_entry.rb
@@ -368,5 +368,20 @@ module RSS
setup_dummy_item_atom(maker)
end
end
+
+ def test_date
+ date = Time.parse("2004/11/1 10:10")
+ feed = Maker.make("atom:entry") do |maker|
+ setup_dummy_channel_atom(maker)
+ maker.channel.date = nil
+ maker.items.new_item do |item|
+ item.link = "http://example.com/article.html"
+ item.title = "Sample Article"
+ item.date = date
+ end
+ end
+ assert_equal(date, feed.items[0].updated.content)
+ assert_equal([date], feed.items[0].dc_dates.collect {|date| date.value})
+ end
end
end
diff --git a/test/rss/test_maker_atom_feed.rb b/test/rss/test_maker_atom_feed.rb
index 8b32189..7a2bb63 100644
--- a/test/rss/test_maker_atom_feed.rb
+++ b/test/rss/test_maker_atom_feed.rb
@@ -401,5 +401,19 @@ module RSS
end
assert_equal(language, feed.dc_language)
end
+
+ def test_date
+ date = Time.parse("2004/11/1 10:10")
+ feed = Maker.make("atom") do |maker|
+ setup_dummy_channel_atom(maker)
+ maker.items.new_item do |item|
+ item.link = "http://example.com/article.html"
+ item.title = "Sample Article"
+ item.date = date
+ end
+ end
+ assert_equal(date, feed.items[0].updated.content)
+ assert_equal([date], feed.items[0].dc_dates.collect {|date| date.value})
+ end
end
end