summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-08 13:51:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-08 13:51:32 +0000
commit393ed5c9504e688d3822d79f09d20da7f7195595 (patch)
tree5da20e38eb6f296920e79368418213b187ebd207 /test/ruby
parent6b4ecb32fbaf41a97be27bf20781b5fdc38d7485 (diff)
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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_eval.rb12
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
#