diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-05 03:03:05 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-05 03:03:05 +0000 |
commit | 71976790ec02f88d9fb51fab151312124f6df223 (patch) | |
tree | 0a70c0031e53d40f05e846486b25f91070274d66 /test/rss/test_maker_0.9.rb | |
parent | 43009063c70fe62028eb035e67a06863b98dc540 (diff) | |
download | ruby-71976790ec02f88d9fb51fab151312124f6df223.tar.gz |
* lib/rss, sample/rss, test/rss:
- 0.1.7 -> 0.1.8.
- supported <itunes:XXX>.
- reverted backward incompatibility API changes introduced 0.1.7.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/test_maker_0.9.rb')
-rw-r--r-- | test/rss/test_maker_0.9.rb | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb index 0551dc2800..df92945a86 100644 --- a/test/rss/test_maker_0.9.rb +++ b/test/rss/test_maker_0.9.rb @@ -267,7 +267,7 @@ module RSS end end - def test_items + def test_items(with_convenience_way=true) title = "TITLE" link = "http://hoge.com/" description = "text hoge fuga" @@ -301,10 +301,10 @@ module RSS setup_dummy_channel(maker) item_size.times do |i| - maker.items.new_item do |item| - item.title = "#{title}#{i}" - item.link = "#{link}#{i}" - item.description = "#{description}#{i}" + maker.items.new_item do |_item| + _item.title = "#{title}#{i}" + _item.link = "#{link}#{i}" + _item.description = "#{description}#{i}" end end maker.items.do_sort = true @@ -312,36 +312,44 @@ module RSS setup_dummy_image(maker) end assert_equal(item_size, rss.items.size) - rss.channel.items.each_with_index do |item, i| - assert_equal("#{title}#{i}", item.title) - assert_equal("#{link}#{i}", item.link) - assert_equal("#{description}#{i}", item.description) + rss.channel.items.each_with_index do |_item, i| + assert_equal("#{title}#{i}", _item.title) + assert_equal("#{link}#{i}", _item.link) + assert_equal("#{description}#{i}", _item.description) end rss = RSS::Maker.make("0.91") do |maker| setup_dummy_channel(maker) item_size.times do |i| - maker.items.new_item do |item| - item.title = "#{title}#{i}" - item.link = "#{link}#{i}" - item.description = "#{description}#{i}" + maker.items.new_item do |_item| + _item.title = "#{title}#{i}" + _item.link = "#{link}#{i}" + _item.description = "#{description}#{i}" end end maker.items.do_sort = Proc.new do |x, y| - y.title.content[-1] <=> x.title.content[-1] + if with_convenience_way + y.title[-1] <=> x.title[-1] + else + y.title {|t| t.content[-1]} <=> x.title {|t| t.content[-1]} + end end setup_dummy_image(maker) end assert_equal(item_size, rss.items.size) - rss.channel.items.reverse.each_with_index do |item, i| - assert_equal("#{title}#{i}", item.title) - assert_equal("#{link}#{i}", item.link) - assert_equal("#{description}#{i}", item.description) + rss.channel.items.reverse.each_with_index do |_item, i| + assert_equal("#{title}#{i}", _item.title) + assert_equal("#{link}#{i}", _item.link) + assert_equal("#{description}#{i}", _item.description) end end + def test_items_with_new_api_since_018 + test_items(false) + end + def test_textInput title = "fugafuga" description = "text hoge fuga" |