summaryrefslogtreecommitdiffstats
path: root/test/rss/test_parser.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-07 03:36:38 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-07 03:36:38 +0000
commit07eb740efe5172ed3c9a8fad84088d26d539da01 (patch)
treeccf92cc3af99d21f06a5a9c32d02e247abe74592 /test/rss/test_parser.rb
parent8cdc3778294e77428b05f16ec7a60ff8d1f7775a (diff)
downloadruby-07eb740efe5172ed3c9a8fad84088d26d539da01.tar.gz
ruby-07eb740efe5172ed3c9a8fad84088d26d539da01.tar.xz
ruby-07eb740efe5172ed3c9a8fad84088d26d539da01.zip
* lib/rss/parser.rb, lib/rss/1.0.rb: accepted rdf:resource or
resource attribute in rdf:li. * test/rss/test_parser.rb: added test for above change. * lib/rss/dublincore.rb: reverted style. * lib/rss/xmlparser.rb: normalized XMLParser class hierarchy. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss/test_parser.rb')
-rw-r--r--test/rss/test_parser.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb
index 461d64d61..05ff9748a 100644
--- a/test/rss/test_parser.rb
+++ b/test/rss/test_parser.rb
@@ -219,6 +219,37 @@ EOR
end
+ def test_rdf_li
+
+ rss = make_RDF(<<-EOR)
+<channel rdf:about="http://example.com/">
+ <title>hoge</title>
+ <link>http://example.com/</link>
+ <description>hogehoge</description>
+ <image rdf:resource="http://example.com/hoge.png" />
+ <items>
+ <rdf:Seq>
+ <rdf:li \#{rdf_li_attr}/>
+ </rdf:Seq>
+ </items>
+ <textinput rdf:resource="http://example.com/search" />
+</channel>
+#{make_item}
+EOR
+
+ source = Proc.new do |rdf_li_attr|
+ eval(%Q[%Q[#{rss}]], binding)
+ end
+
+ attr = %q[resource="http://example.com/hoge"]
+ assert_parse(source.call(attr), :nothing_raised)
+
+ attr = %q[rdf:resource="http://example.com/hoge"]
+ assert_parse(source.call(attr), :nothing_raised)
+
+ assert_parse(source.call(""), :missing_attribute, "li", "resource")
+ end
+
def test_image
assert_parse(make_RDF(<<-EOR), :missing_attribute, "image", "about")