summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 23:04:48 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 23:04:48 +0000
commit08f46f0818858bd58209d4766ea5a97266665b1d (patch)
treebf551cb3de0cce5d9c320ed483883244259b5c4a /test/rss
parentc47cca2f858f2665a6424e417745a9fd7e78003c (diff)
Wed Jul 18 08:01:10 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>
* test/rss/test_dublincore.rb: update test for CGI.escapeHTML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/test_dublincore.rb22
1 files changed, 6 insertions, 16 deletions
diff --git a/test/rss/test_dublincore.rb b/test/rss/test_dublincore.rb
index 22b8148..dcafdd3 100644
--- a/test/rss/test_dublincore.rb
+++ b/test/rss/test_dublincore.rb
@@ -149,14 +149,8 @@ EOR
plural_suffix = dc_plural_suffix(name, check_backward_compatibility)
plural_reader = "dc_#{name}#{plural_suffix}"
- values = parent.__send__(plural_reader).collect do |x|
- val = x.value
- if val.kind_of?(String)
- CGI.escapeHTML(val)
- else
- val
- end
- end
+ values = parent.__send__(plural_reader).collect(&:value)
+ value = CGI.unescapeHTML(value) if value.kind_of?(String)
assert_equal([value, value], values)
end
end
@@ -170,9 +164,7 @@ EOR
parent = chain_reader(feed, parent_readers)
DC_ELEMENTS.each do |name, value|
parsed_value = parent.__send__("dc_#{name}")
- if parsed_value.kind_of?(String)
- parsed_value = CGI.escapeHTML(parsed_value)
- end
+ value = CGI.unescapeHTML(value) if value.kind_of?(String)
assert_equal(value, parsed_value)
if name == :date
t = Time.iso8601("2003-01-01T02:30:23+09:00")
@@ -206,9 +198,7 @@ EOR
parents.each do |parent_readers|
parent = chain_reader(feed, parent_readers)
parsed_value = parent.__send__("dc_#{name}")
- if parsed_value.kind_of?(String)
- parsed_value = CGI.escapeHTML(parsed_value)
- end
+ value = CGI.unescapeHTML(value) if value.kind_of?(String)
assert_equal(value, parsed_value)
plural_suffix = dc_plural_suffix(name, check_backward_compatibility)
@@ -269,8 +259,8 @@ EOR
parent = feed_root.elements[target_xpath]
parent.each_element do |elem|
if elem.namespace == DC_URI
- assert_equal(CGI.escapeHTML(elem.text),
- DC_ELEMENTS[elem.name.intern].to_s)
+ assert_equal(elem.text,
+ CGI.unescapeHTML(DC_ELEMENTS[elem.name.intern].to_s))
end
end
end