summaryrefslogtreecommitdiff
path: root/spec/ruby/command_line/rubyopt_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-10-24 15:52:37 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-10-24 15:53:53 +0200
commit148961adcd0704d964fce920330a6301b9704c25 (patch)
tree1f1f0cb7326775788683c77f0e2cceb495d3cc95 /spec/ruby/command_line/rubyopt_spec.rb
parent342fbae83c2e80d1b49656bc7c689cc7fe8980ce (diff)
Update to ruby/spec@4f59d86
Diffstat (limited to 'spec/ruby/command_line/rubyopt_spec.rb')
-rw-r--r--spec/ruby/command_line/rubyopt_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/ruby/command_line/rubyopt_spec.rb b/spec/ruby/command_line/rubyopt_spec.rb
index 2db42f77ef..ee4e594a1c 100644
--- a/spec/ruby/command_line/rubyopt_spec.rb
+++ b/spec/ruby/command_line/rubyopt_spec.rb
@@ -59,6 +59,26 @@ describe "Processing RUBYOPT" do
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
end
+ ruby_version_is "2.7" do
+ it "suppresses deprecation warnings for '-W:no-deprecated'" do
+ ENV["RUBYOPT"] = '-W:no-deprecated'
+ result = ruby_exe('$; = ""', args: '2>&1')
+ result.should == ""
+ end
+
+ it "suppresses experimental warnings for '-W:no-experimental'" do
+ ENV["RUBYOPT"] = '-W:no-experimental'
+ result = ruby_exe('0 in a', args: '2>&1')
+ result.should == ""
+ end
+
+ it "suppresses deprecation and experimental warnings for '-W:no-deprecated -W:no-experimental'" do
+ ENV["RUBYOPT"] = '-W:no-deprecated -W:no-experimental'
+ result = ruby_exe('($; = "") in a', args: '2>&1')
+ result.should == ""
+ end
+ end
+
it "requires the file for '-r'" do
f = fixture __FILE__, "rubyopt"
ENV["RUBYOPT"] = "-r#{f}"