summaryrefslogtreecommitdiff
path: root/test/rss/test_maker_2.0.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-21 12:19:43 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-21 12:19:43 +0000
commit57a639494a2a002f496a945979e2bf499b0d9fdb (patch)
tree53fadfc1666459e1286735a37171539883d66d70 /test/rss/test_maker_2.0.rb
parent754b1fac44487454cc25a14443615c0fba3da6ad (diff)
* lib/rss.rb, lib/rss/, test/rss/, sample/rss/: merged from trunk.
- 0.1.6 -> 2.0.0. - fixed image module URI. Thanks to Dmitry Borodaenko. - supported Atom. - supported ITunes module. - supported Slash module. * NEWS: added an entry for RSS Parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/test_maker_2.0.rb')
-rw-r--r--test/rss/test_maker_2.0.rb27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index ec5f3abb8e..8fd9134f70 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -353,7 +353,7 @@ module RSS
assert_nil(rss.image)
end
- def test_items
+ def test_items(with_convenience_way=true)
title = "TITLE"
link = "http://hoge.com/"
description = "text hoge fuga"
@@ -407,7 +407,11 @@ module RSS
end
end
maker.items.do_sort = Proc.new do |x, y|
- y.title[-1] <=> x.title[-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
end
assert_equal(item_size, rss.items.size)
@@ -422,6 +426,10 @@ module RSS
end
end
+ def test_items_with_new_api_since_018
+ test_items(false)
+ end
+
def test_guid
isPermaLink = "true"
content = "http://inessential.com/2002/09/01.php#a2"
@@ -606,15 +614,16 @@ module RSS
assert_equal(name, textInput.name)
assert_equal(link, textInput.link)
- rss = RSS::Maker.make("2.0") do |maker|
- # setup_dummy_channel(maker)
+ assert_not_set_error("maker.channel", %w(link description title)) do
+ RSS::Maker.make("2.0") do |maker|
+ # setup_dummy_channel(maker)
- maker.textinput.title = title
- maker.textinput.description = description
- maker.textinput.name = name
- maker.textinput.link = link
+ maker.textinput.title = title
+ maker.textinput.description = description
+ maker.textinput.name = name
+ maker.textinput.link = link
+ end
end
- assert_nil(rss)
end
def test_not_valid_textInput