From 393ed5c9504e688d3822d79f09d20da7f7195595 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Aug 2012 13:51:32 +0000 Subject: vm_eval.c: cref-scope hack * vm_eval.c (eval_under): singletons other than special constants don't need cref-scope hack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_eval.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') 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 # -- cgit v1.2.3