diff options
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 5fc3d4a541..812b7f6a31 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1360,6 +1360,13 @@ class TestModule < Test::Unit::TestCase assert_equal("foo", c::FOO) end + def test_deprecate_constant + c = Class.new + c.const_set(:FOO, "foo") + c.deprecate_constant(:FOO) + assert_warn(/deprecated/) {c::FOO} + end + def test_constants_with_private_constant assert_not_include(::TestModule.constants, :PrivateClass) end |