mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@6115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4ded52b623
commit
8dfa6fb0a8
9 changed files with 84 additions and 38 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue