summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/erb/test_erb.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 05d255623a..6fe59a68b6 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'
@@ -37,6 +38,15 @@ class TestERB < Test::Unit::TestCase
}
assert_match(/\Atest filename:1\b/, e.backtrace[0])
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