summaryrefslogtreecommitdiff
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.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 7ddbc87..686c404 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
require 'test/unit'
require 'erb'
@@ -44,11 +45,20 @@ 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("&lt;&lt;", ERB::Util.html_escape("<\<"))
assert_equal("", ERB::Util.html_escape(nil))
assert_equal("123", ERB::Util.html_escape(123))
end
+
+ def test_concurrent_default_binding
+ template1 = 'one <%= ERB.new(template2).result %>'
+
+ eval 'template2 = "two"', TOPLEVEL_BINDING
+
+ bug7046 = '[ruby-core:47638]'
+ assert_equal("one two", ERB.new(template1).result, bug7046)
+ end
end
class TestERBCore < Test::Unit::TestCase