ruby-changes:11793
From: kou <ko1@a...>
Date: Sat, 16 May 2009 18:10:06 +0900 (JST)
Subject: [ruby-changes:11793] Ruby:r23448 (trunk): * lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb:
kou 2009-05-16 18:08:58 +0900 (Sat, 16 May 2009) New Revision: 23448 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23448 Log: * lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb: remove needless codes. Modified files: trunk/ChangeLog trunk/lib/rss/maker/feed.rb trunk/test/rss/test_maker_atom_feed.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 23447) +++ ChangeLog (revision 23448) @@ -1,3 +1,8 @@ +Sat May 16 18:07:17 2009 Kouhei Sutou <kou@c...> + + * lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb: + remove needless codes. + Sat May 16 18:05:07 2009 Kouhei Sutou <kou@c...> * lib/rss/maker/entry.rb: fix a typo. Index: lib/rss/maker/feed.rb =================================================================== --- lib/rss/maker/feed.rb (revision 23447) +++ lib/rss/maker/feed.rb (revision 23448) @@ -73,14 +73,11 @@ def _set_default_values(&block) keep = { :id => id, - :updated => updated, } self.id ||= about - self.updated ||= dc_date super(&block) ensure self.id = keep[:id] - self.updated = keep[:updated] end class SkipDays < SkipDaysBase @@ -219,14 +216,11 @@ def _set_default_values(&block) keep = { :id => id, - :updated => updated, } self.id ||= link - self.updated ||= dc_date super(&block) ensure self.id = keep[:id] - self.updated = keep[:updated] end class Guid < GuidBase Index: test/rss/test_maker_atom_feed.rb =================================================================== --- test/rss/test_maker_atom_feed.rb (revision 23447) +++ test/rss/test_maker_atom_feed.rb (revision 23448) @@ -408,12 +408,38 @@ setup_dummy_channel_atom(maker) maker.items.new_item do |item| item.link = "http://example.com/article.html" - item.title = "Sample Article" + 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 + + def test_channel_dc_date + date = Time.parse("2004/11/1 10:10") + feed = Maker.make("atom") do |maker| + setup_dummy_channel_atom(maker) + maker.channel.updated = nil + maker.channel.dc_date = date + setup_dummy_item_atom(maker) + end + assert_equal(date, feed.updated.content) + assert_equal([date], feed.dc_dates.collect {|date| date.value}) + end + + def test_item_dc_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.dc_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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/