diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-30 14:31:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-30 14:31:35 +0000 |
commit | b84eed5dd8e2cb981a80091a58775a7d21946e5b (patch) | |
tree | c0326435342a3339ac54be4e48855d21bcc0c090 /test | |
parent | 19e672cce9590c09b6beb3ada4ccf0e62bf6610c (diff) |
ruby.c: respect features by command line
* ruby.c (process_options): feature options in command line
arguments take precedence over options in RUBYOPT environment
variable. [ruby-core:92052] [Bug #15738]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 4a3599c7d3..0f697f949f 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -968,8 +968,10 @@ class TestRubyOptions < Test::Unit::TestCase [["disable", "false"], ["enable", "true"]].each do |opt, exp| %W[frozen_string_literal frozen-string-literal].each do |arg| key = "#{opt}=#{arg}" + negopt = exp ? "disable" : "enable" + env = {"RUBYOPT"=>"--#{negopt}=#{arg}"} a.for(key) do - assert_in_out_err(["--disable=gems", "--#{key}"], 'p("foo".frozen?)', [exp]) + assert_in_out_err([env, "--disable=gems", "--#{key}"], 'p("foo".frozen?)', [exp]) end end end |