ruby.c: command line option over RUBYOPT env

* ruby.c (proc_options): -W command line option should be able to
  override -w in RUBYOPT environment variable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-12-29 10:12:48 +00:00
parent b6b1038c6b
commit 66fe2c0dd9
3 changed files with 17 additions and 2 deletions

View file

@ -258,6 +258,10 @@ class TestRubyOptions < Test::Unit::TestCase
assert_equal([], e)
end
ENV['RUBYOPT'] = '-w'
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"])
ensure
if rubyopt_orig
ENV['RUBYOPT'] = rubyopt_orig