diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_module.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 16485c30d1..16f9850c18 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1130,6 +1130,27 @@ class TestModule < Test::Unit::TestCase assert_in_out_err([], src, %w(Object :ok), []) end + def test_private_constants_clear_inlinecache + bug5702 = '[ruby-dev:44929]' + src = <<-INPUT + class A + C = :Const + def self.get_C + A::C + end + # fill cache + A.get_C + private_constant :C, :D rescue nil + begin + A.get_C + rescue NameError + puts "A.get_C" + end + end + INPUT + assert_in_out_err([], src, %w(A.get_C), [], bug5702) + end + def test_constant_lookup_in_method_defined_by_class_eval src = <<-INPUT class A |
