diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_eval.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_eval.rb b/test/ruby/test_eval.rb index 1d976b3052..e1de99c847 100644 --- a/test/ruby/test_eval.rb +++ b/test/ruby/test_eval.rb @@ -215,6 +215,18 @@ class TestEval < Test::Unit::TestCase end end + class Foo + Bar = 2 + end + + def test_instance_eval_const + bar = nil + assert_nothing_raised(NameError) do + bar = Foo.new.instance_eval("Bar") + end + assert_equal(2, bar) + end + # # From ruby/test/ruby/test_eval.rb # |