mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rss: Accept empty text element as valid element
Parser has been accepted it but XML serializer wasn't accepted. Reported by stefano frabetti. Thanks!!! [ruby-core:80965] [Bug #13531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7abf8bae23
commit
6faa8408e5
2 changed files with 25 additions and 1 deletions
|
@ -957,7 +957,7 @@ EOC
|
||||||
children = child
|
children = child
|
||||||
children.any? {|c| c.have_required_elements?}
|
children.any? {|c| c.have_required_elements?}
|
||||||
else
|
else
|
||||||
!child.to_s.empty?
|
not child.nil?
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
true
|
true
|
||||||
|
|
|
@ -109,6 +109,30 @@ module RSS
|
||||||
'[ruby-core:70667] [Bug #11509]')
|
'[ruby-core:70667] [Bug #11509]')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_20_empty_text
|
||||||
|
title = "Blog entries"
|
||||||
|
link = "http://blog.example.com/"
|
||||||
|
description = ""
|
||||||
|
rss = RSS::Maker.make("2.0") do |maker|
|
||||||
|
maker.channel.title = title
|
||||||
|
maker.channel.link = link
|
||||||
|
maker.channel.description = description
|
||||||
|
end
|
||||||
|
|
||||||
|
parsed_rss = RSS::Parser.parse(rss.to_s)
|
||||||
|
assert_equal({
|
||||||
|
title: title,
|
||||||
|
link: link,
|
||||||
|
description: description,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: parsed_rss.channel.title,
|
||||||
|
link: parsed_rss.channel.link,
|
||||||
|
description: parsed_rss.channel.description,
|
||||||
|
},
|
||||||
|
"[ruby-core:80965] [Bug #13531]")
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def setup_xml_declaration_info
|
def setup_xml_declaration_info
|
||||||
@version = "1.0"
|
@version = "1.0"
|
||||||
|
|
Loading…
Reference in a new issue