summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2020-08-31 14:58:31 +0900
committerNobuyoshi Nakada <[email protected]>2020-09-25 09:50:33 +0900
commit996af2ce086249e904b2ce95ab2fcd1de7d757be (patch)
tree1b70f747a0eefc32be13f05bdb037275d1e664a1 /test/ruby/test_rubyoptions.rb
parent83ff0f74bf69650754cac020bcd4ff9adbba877e (diff)
Disable deprecation warning by the default [Feature #16345]
And `-w` option turns it on.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3481
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 7101175568..6ca8dbea33 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'