mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
754b1fac44
commit
57a639494a
81 changed files with 11826 additions and 1691 deletions
38
test/rss/test_setup_maker_slash.rb
Normal file
38
test/rss/test_setup_maker_slash.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
require "rss-testcase"
|
||||
|
||||
require "rss/maker"
|
||||
|
||||
module RSS
|
||||
class TestSetupMakerSlash < TestCase
|
||||
def test_setup_maker
|
||||
elements = {
|
||||
"section" => "articles",
|
||||
"department" => "not-an-ocean-unless-there-are-lobsters",
|
||||
"comments" => 177,
|
||||
"hit_parades" => [177, 155, 105, 33, 6, 3, 0],
|
||||
}
|
||||
|
||||
rss = RSS::Maker.make("rss1.0") do |maker|
|
||||
setup_dummy_channel(maker)
|
||||
setup_dummy_item(maker)
|
||||
|
||||
item = maker.items.last
|
||||
item.slash_section = elements["section"]
|
||||
item.slash_department = elements["department"]
|
||||
item.slash_comments = elements["comments"]
|
||||
item.slash_hit_parade = elements["hit_parades"].join(",")
|
||||
end
|
||||
assert_not_nil(rss)
|
||||
|
||||
new_rss = RSS::Maker.make("rss1.0") do |maker|
|
||||
rss.setup_maker(maker)
|
||||
end
|
||||
assert_not_nil(new_rss)
|
||||
|
||||
item = new_rss.items.last
|
||||
assert_not_nil(item)
|
||||
|
||||
assert_slash_elements(elements, item)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue