aboutsummaryrefslogtreecommitdiffstats
path: root/test/erb/test_erb.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/erb/test_erb.rb')
-rw-r--r--test/erb/test_erb.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 424ddae87e..1db0e55f8a 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -73,11 +73,24 @@ class TestERB < Test::Unit::TestCase
assert_equal("", ERB::Util.html_escape(""))
assert_equal("abc", ERB::Util.html_escape("abc"))
assert_equal("&lt;&lt;", ERB::Util.html_escape("<\<"))
+ assert_equal("&#39;&amp;&quot;&gt;&lt;", ERB::Util.html_escape("'&\"><"))
assert_equal("", ERB::Util.html_escape(nil))
assert_equal("123", ERB::Util.html_escape(123))
end
+ def test_html_escape_to_s
+ object = Object.new
+ def object.to_s
+ "object"
+ end
+ assert_equal("object", ERB::Util.html_escape(object))
+ end
+
+ def test_html_escape_extension
+ assert_nil(ERB::Util.method(:html_escape).source_location)
+ end if RUBY_ENGINE == 'ruby'
+
def test_concurrent_default_binding
# This test randomly fails with JRuby -- NameError: undefined local variable or method `template2'
pend if RUBY_ENGINE == 'jruby'