summaryrefslogtreecommitdiff
path: root/test/rss/test_maker_2.0.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-17 01:28:46 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-17 01:28:46 +0000
commit02cce7ed8273bab55081357c57f24a8265a6f32a (patch)
tree81fcc7a474ce90e19acf57390e5b5795849de6c0 /test/rss/test_maker_2.0.rb
parent463c6a218fed7248531a002806e9b07be7f5a6ea (diff)
* lib/rss/rss.rb (Kernel#funcall): removed.
* lib/rss/parser.rb (Kernel.URI): removed. * lib/rss/maker/: supported xxx.new_yyy do |yyy| yyy.zzz = zzz ... end style and this style became the style of the recommendation. Old style yyy = xxx.new_yyy yyy.zzz = zzz ... is supported too but this style isn't recommended. [ruby-talk:197284] * test/rss/test_*maker*.rb: used new recommended style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/test_maker_2.0.rb')
-rw-r--r--test/rss/test_maker_2.0.rb57
1 files changed, 32 insertions, 25 deletions
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index 2c581f75ea..ec5f3abb8e 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -82,17 +82,20 @@ module RSS
maker.channel.lastBuildDate = lastBuildDate
skipDays.each do |day|
- new_day = maker.channel.skipDays.new_day
- new_day.content = day
+ maker.channel.skipDays.new_day do |new_day|
+ new_day.content = day
+ end
end
skipHours.each do |hour|
- new_hour = maker.channel.skipHours.new_hour
- new_hour.content = hour
+ maker.channel.skipHours.new_hour do |new_hour|
+ new_hour.content = hour
+ end
end
categories.each do |category|
- new_category = maker.channel.categories.new_category
- new_category.content = category
+ maker.channel.categories.new_category do |new_category|
+ new_category.content = category
+ end
end
maker.channel.generator = generator
@@ -368,13 +371,14 @@ module RSS
setup_dummy_channel(maker)
item_size.times do |i|
- item = maker.items.new_item
- item.title = "#{title}#{i}"
- item.link = "#{link}#{i}"
- item.description = "#{description}#{i}"
- item.author = "#{author}#{i}"
- item.comments = "#{comments}#{i}"
- item.date = pubDate
+ maker.items.new_item do |item|
+ item.title = "#{title}#{i}"
+ item.link = "#{link}#{i}"
+ item.description = "#{description}#{i}"
+ item.author = "#{author}#{i}"
+ item.comments = "#{comments}#{i}"
+ item.date = pubDate
+ end
end
maker.items.do_sort = true
end
@@ -393,13 +397,14 @@ module RSS
setup_dummy_channel(maker)
item_size.times do |i|
- item = maker.items.new_item
- item.title = "#{title}#{i}"
- item.link = "#{link}#{i}"
- item.description = "#{description}#{i}"
- item.author = "#{author}#{i}"
- item.comments = "#{comments}#{i}"
- item.date = pubDate
+ maker.items.new_item do |item|
+ item.title = "#{title}#{i}"
+ item.link = "#{link}#{i}"
+ item.description = "#{description}#{i}"
+ item.author = "#{author}#{i}"
+ item.comments = "#{comments}#{i}"
+ item.date = pubDate
+ end
end
maker.items.do_sort = Proc.new do |x, y|
y.title[-1] <=> x.title[-1]
@@ -557,9 +562,10 @@ module RSS
setup_dummy_channel(maker)
setup_dummy_item(maker)
- category = maker.items.last.categories.new_category
- category.domain = domain
- category.content = content
+ maker.items.last.categories.new_category do |category|
+ category.domain = domain
+ category.content = content
+ end
end
category = rss.channel.items.last.categories.last
assert_equal(domain, category.domain)
@@ -573,8 +579,9 @@ module RSS
setup_dummy_channel(maker)
setup_dummy_item(maker)
- category = maker.items.last.categories.new_category
- # category.content = content
+ maker.items.last.categories.new_category do |category|
+ # category.content = content
+ end
end
assert(rss.channel.items.last.categories.empty?)
end