From 148961adcd0704d964fce920330a6301b9704c25 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 24 Oct 2020 15:52:37 +0200 Subject: Update to ruby/spec@4f59d86 --- spec/ruby/command_line/dash_upper_w_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec/ruby/command_line/dash_upper_w_spec.rb') diff --git a/spec/ruby/command_line/dash_upper_w_spec.rb b/spec/ruby/command_line/dash_upper_w_spec.rb index 31bb976ad2..8343bc08e4 100644 --- a/spec/ruby/command_line/dash_upper_w_spec.rb +++ b/spec/ruby/command_line/dash_upper_w_spec.rb @@ -18,3 +18,25 @@ end describe "The -W command line option with 2" do it_behaves_like :command_line_verbose, "-W2" end + +ruby_version_is "2.7" do + describe "The -W command line option with :no-deprecated" do + it "suppresses deprecation warnings" do + result = ruby_exe('$; = ""', options: '-w', args: '2>&1') + result.should =~ /is deprecated/ + + result = ruby_exe('$; = ""', options: '-w -W:no-deprecated', args: '2>&1') + result.should == "" + end + end + + describe "The -W command line option with :no-experimental" do + it "suppresses experimental warnings" do + result = ruby_exe('0 in a', args: '2>&1') + result.should =~ /is experimental/ + + result = ruby_exe('0 in a', options: '-W:no-experimental', args: '2>&1') + result.should == "" + end + end +end -- cgit v1.2.3