mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb:
remove needless codes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a7cf993f25
commit
b49be81dbb
3 changed files with 32 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat May 16 18:07:17 2009 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/maker/feed.rb, test/test_maker_atom_feed.rb:
|
||||
remove needless codes.
|
||||
|
||||
Sat May 16 18:05:07 2009 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss/maker/entry.rb: fix a typo.
|
||||
|
|
|
@ -73,14 +73,11 @@ module RSS
|
|||
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 @@ module RSS
|
|||
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
|
||||
|
|
|
@ -408,12 +408,38 @@ module RSS
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue