summaryrefslogtreecommitdiff
path: root/test/ruby/test_rubyoptions.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 10:12:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-29 10:12:48 +0000
commit66fe2c0dd9f30efe785ce5f7411d9386fbcfeadc (patch)
treeb8d4477b36f117be59a5c5a14ba505d0437b255b /test/ruby/test_rubyoptions.rb
parentb6b1038c6bc487b0b8f7d1675d02a22a4ee8f4b8 (diff)
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
Diffstat (limited to 'test/ruby/test_rubyoptions.rb')
-rw-r--r--test/ruby/test_rubyoptions.rb4
1 files changed, 4 insertions, 0 deletions
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