summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-17 14:52:15 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-19 09:52:16 +0900
commit9bf9de3d9d2f67bc401151fb94abf75b5eff5913 (patch)
tree94d1c981d7e604834c3ee9a5072f24a8fd199e63 /test
parent76035e5bb6a5b44621fd1c11a0553780474d1c01 (diff)
Made the warning for deprecated constants follow the category flag
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 3ddfcd9c4f..2e7e5804d0 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -28,10 +28,13 @@ class TestModule < Test::Unit::TestCase
def setup
@verbose = $VERBOSE
$VERBOSE = nil
+ @deprecated = Warning[:deprecated]
+ Warning[:deprecated] = true
end
def teardown
$VERBOSE = @verbose
+ Warning[:deprecated] = @deprecated
end
def test_LT_0
@@ -1580,6 +1583,8 @@ class TestModule < Test::Unit::TestCase
assert_warn(/#{c}::FOO is deprecated/) {Class.new(c)::FOO}
bug12382 = '[ruby-core:75505] [Bug #12382]'
assert_warn(/deprecated/, bug12382) {c.class_eval "FOO"}
+ Warning[:deprecated] = false
+ assert_warn('') {c::FOO}
end
NIL = nil