From df3f52a6331f1a47af9933b77311a8650727d8d1 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 29 Sep 2020 22:43:25 +0900 Subject: merge revision(s) 996af2ce086249e904b2ce95ab2fcd1de7d757be: [Backport #16345] [Backport #17000] Disable deprecation warning by the default [Feature #16345] And `-w` option turns it on. --- test/ruby/test_rubyoptions.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby/test_rubyoptions.rb') diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 093720b1fc..fba53cd982 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -80,6 +80,9 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err(%w(-W:experimental -e) + ['p Warning[:experimental]'], "", %w(true), []) assert_in_out_err(%w(-W:no-experimental -e) + ['p Warning[:experimental]'], "", %w(false), []) assert_in_out_err(%w(-W:qux), "", [], /unknown warning category: `qux'/) + assert_in_out_err(%w(-w -e) + ['p Warning[:deprecated]'], "", %w(true), []) + assert_in_out_err(%w(-W -e) + ['p Warning[:deprecated]'], "", %w(true), []) + assert_in_out_err(%w(-e) + ['p Warning[:deprecated]'], "", %w(false), []) ensure ENV['RUBYOPT'] = save_rubyopt end @@ -333,6 +336,10 @@ class TestRubyOptions < Test::Unit::TestCase assert_in_out_err(%w(), "p $VERBOSE", ["true"]) assert_in_out_err(%w(-W1), "p $VERBOSE", ["false"]) assert_in_out_err(%w(-W0), "p $VERBOSE", ["nil"]) + assert_in_out_err(%w(), "p Warning[:deprecated]", ["true"]) + assert_in_out_err(%w(-W0), "p Warning[:deprecated]", ["false"]) + assert_in_out_err(%w(-W1), "p Warning[:deprecated]", ["false"]) + assert_in_out_err(%w(-W2), "p Warning[:deprecated]", ["true"]) ENV['RUBYOPT'] = '-W:deprecated' assert_in_out_err(%w(), "p Warning[:deprecated]", ["true"]) ENV['RUBYOPT'] = '-W:no-deprecated' -- cgit v1.2.3