summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-12-08 09:00:04 -0800
committerJeremy Evans <code@jeremyevans.net>2020-12-10 10:16:40 -0800
commitdca13e2bf7b7efeb2841a039e3cfd7b5cd650a7b (patch)
tree795125a73f5c292dbc6fba267cff997f34b02eb3 /test/ruby
parent699608487d2ff09bb5c610a9d1e6e13f5bd2a25e (diff)
Make ruby -We the same as ruby -W -e
This changes the behavior, which I'm not sure is acceptable. However, it's odd to allow an option to be combined, but change the behavior of the option when combined.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3867
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_rubyoptions.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index be08ec6acc..7b1df5bc88 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -72,8 +72,9 @@ class TestRubyOptions < Test::Unit::TestCase
ENV['RUBYOPT'] = nil
assert_in_out_err(%w(-W0 -e) + ['p $-W'], "", %w(0), [])
assert_in_out_err(%w(-W1 -e) + ['p $-W'], "", %w(1), [])
- assert_in_out_err(%w(-Wx -e) + ['p $-W'], "", %w(1), [])
+ assert_in_out_err(%w(-Wx -e) + ['p $-W'], "", %w(2), [])
assert_in_out_err(%w(-W -e) + ['p $-W'], "", %w(2), [])
+ assert_in_out_err(%w(-We) + ['p $-W'], "", %w(2), [])
assert_in_out_err(%w(-w -W0 -e) + ['p $-W'], "", %w(0), [])
assert_in_out_err(%w(-W:deprecated -e) + ['p Warning[:deprecated]'], "", %w(true), [])
assert_in_out_err(%w(-W:no-deprecated -e) + ['p Warning[:deprecated]'], "", %w(false), [])
@@ -82,6 +83,7 @@ class TestRubyOptions < Test::Unit::TestCase
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(-We) + ['p Warning[:deprecated]'], "", %w(true), [])
assert_in_out_err(%w(-e) + ['p Warning[:deprecated]'], "", %w(false), [])
ensure
ENV['RUBYOPT'] = save_rubyopt