1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/rss/test_maker_dc.rb (test_date): added a test for #date=

and #dc_date=.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2005-04-07 05:42:56 +00:00
parent f382841107
commit d8c66e0546
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Apr 7 14:33:09 2005 Kouhei Sutou <kou@cozmixng.org>
* test/rss/test_maker_dc.rb (test_date): added a test for #date=
and #dc_date=.
Thu Apr 7 11:49:53 2005 Kouhei Sutou <kou@cozmixng.org> Thu Apr 7 11:49:53 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/maker/dublincore.rb: _really_ supported multiple Dublin * lib/rss/maker/dublincore.rb: _really_ supported multiple Dublin

View file

@ -95,6 +95,26 @@ module RSS
assert_multiple_dublin_core(elems, rss.textinput) assert_multiple_dublin_core(elems, rss.textinput)
end end
def test_date
t1 = Time.iso8601("2000-01-01T12:00:05+00:00")
t2 = Time.iso8601("2005-01-01T12:00:05+00:00")
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
maker.channel.date = t1
date = maker.channel.dc_dates.new_date
date.value = t2
setup_dummy_item(maker)
item = maker.items.last
item.date = t2
date = item.dc_dates.new_date
date.value = t1
end
assert_equal([t1, t2], rss.channel.dc_dates.collect{|x| x.value})
assert_equal([t2, t1], rss.items.last.dc_dates.collect{|x| x.value})
end
private private
def accessor_name(name) def accessor_name(name)
"dc_#{name}" "dc_#{name}"