summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-03 12:25:17 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-03 12:25:17 +0000
commit6faa8408e57e2e975dbf9ee3e56b1316672db4e0 (patch)
treec630331d8362ccdd157ac5a732b773afa7ef2172 /test/rss
parent7abf8bae236f48ca27698b451d2c16a3c3ab5d0e (diff)
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
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/test_to_s.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/rss/test_to_s.rb b/test/rss/test_to_s.rb
index b8ef0d8da4..bbdd74ef0b 100644
--- a/test/rss/test_to_s.rb
+++ b/test/rss/test_to_s.rb
@@ -109,6 +109,30 @@ module RSS
'[ruby-core:70667] [Bug #11509]')
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
def setup_xml_declaration_info
@version = "1.0"