summaryrefslogtreecommitdiff
path: root/test/rss/common.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-13 11:02:03 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-13 11:02:03 +0000
commitc0306157d9dbb12447ba5288b8a2db73b2beef11 (patch)
tree7c900356e107f5a66c051a535e9dfab8b103eca8 /test/rss/common.rb
parent82482f67e25e8239d17a0ee9d209dca3c6fbb2f9 (diff)
* test/rss/test_trackback.rb: added tests for TrackBack with RSS
2.0. * test/rss/common.rb: added methods make RSS 2.0. * lib/rss/trackback.rb: TrackBack API is decided. * lib/rss/rss.rb: RSS::VERSION 0.0.7 -> 0.0.8 * lib/rss/parser.rb, lib/rss/rss.rb: replaced $DEBUG by RSS::DEBUG. * lib/rss/2.0.rb: removed RSS 2.0 URI. Because RSS 2.0 doesn't have URI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/common.rb')
-rw-r--r--test/rss/common.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/rss/common.rb b/test/rss/common.rb
index d41d79e2db..64bf0100fc 100644
--- a/test/rss/common.rb
+++ b/test/rss/common.rb
@@ -99,4 +99,49 @@ EOI
</textinput>
EOT
end
+
+ def make_Rss2(content=nil, xmlns=[])
+ <<-EORSS
+#{make_xmldecl}
+<rss version="2.0"
+#{xmlns.collect {|pre, uri| "xmlns:#{pre}='#{uri}'"}.join(' ')}>
+#{block_given? ? yield : content}
+</rss>
+EORSS
+ end
+
+ def make_channel2(content=nil)
+ <<-EOC
+<channel>
+ <title>#{TITLE_VALUE}</title>
+ <link>#{LINK_VALUE}</link>
+ <description>#{DESCRIPTION_VALUE}</description>
+
+ <image>
+ <url>#{RDF_RESOURCE}</url>
+ <title>#{TITLE_VALUE}</title>
+ <link>#{LINK_VALUE}</link>
+ </image>
+
+#{RESOURCES.collect do |res| '<item><link>' + res + '</link></item>' end.join("\n")}
+
+ <textInput>
+ <link>#{RDF_RESOURCE}</link>
+ </textInput>
+
+#{block_given? ? yield : content}
+</channel>
+EOC
+ end
+
+ def make_item2(content=nil)
+ <<-EOI
+<item>
+ <title>#{TITLE_VALUE}</title>
+ <link>#{LINK_VALUE}</link>
+ <description>#{DESCRIPTION_VALUE}</description>
+#{block_given? ? yield : content}
+</item>
+EOI
+ end
end