diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-07 05:42:56 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-07 05:42:56 +0000 |
| commit | 65c3d30db79e602f3a0c6cfa51ab565e586670bc (patch) | |
| tree | 2a47033b64c91d8cc956c666a0928a1c4be8e1a3 /test/rss | |
| parent | eb36935c23d8c06212b160a6011bb94ffd509106 (diff) | |
| download | ruby-65c3d30db79e602f3a0c6cfa51ab565e586670bc.tar.gz ruby-65c3d30db79e602f3a0c6cfa51ab565e586670bc.tar.xz ruby-65c3d30db79e602f3a0c6cfa51ab565e586670bc.zip | |
* test/rss/test_maker_dc.rb (test_date): added a test for #date=
and #dc_date=.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
| -rw-r--r-- | test/rss/test_maker_dc.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rss/test_maker_dc.rb b/test/rss/test_maker_dc.rb index 92ae4055d..9f568ed44 100644 --- a/test/rss/test_maker_dc.rb +++ b/test/rss/test_maker_dc.rb @@ -95,6 +95,26 @@ module RSS assert_multiple_dublin_core(elems, rss.textinput) 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 def accessor_name(name) "dc_#{name}" |
