diff options
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 6d28616d86..10b2708804 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1049,4 +1049,23 @@ class TestModule < Test::Unit::TestCase INPUT assert_in_out_err([], src, ["uninitialized constant A"], []) end + + def test_constant_lookup_in_module_in_class_eval + src = <<-INPUT + class A + B = 42 + end + + A.class_eval do + module C + begin + B + rescue NameError + puts "NameError" + end + end + end + INPUT + assert_in_out_err([], src, ["NameError"], []) + end end |