* 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
This commit is contained in:
kou 2009-05-16 09:03:04 +00:00
Родитель 277f48de57
Коммит 01fb989358
4 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sat May 16 18:02:57 2009 Kouhei Sutou <kou@cozmixng.org>
* 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]
Sat May 16 18:02:16 2009 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/maker/base.rb, lib/rss/maker/1.0.rb, lib/rss/maker/feed.rb,

Просмотреть файл

@ -184,6 +184,7 @@ module RSS
set_default_values do
entry = feed.class::Entry.new
set = setup_values(entry)
entry.dc_dates.clear
setup_other_elements(feed, entry)
if set
feed.entries << entry

Просмотреть файл

@ -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

Просмотреть файл

@ -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