From 66fe2c0dd9f30efe785ce5f7411d9386fbcfeadc Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 29 Dec 2015 10:12:48 +0000 Subject: 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 --- test/ruby/test_rubyoptions.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby/test_rubyoptions.rb') diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 72672292b7..95d60d9933 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -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 -- cgit v1.2.3