From 28ff1f9a79aef158c93d546051796fcf6a87d6e6 Mon Sep 17 00:00:00 2001 From: lxxxvi Date: Wed, 21 Oct 2020 09:34:41 +0200 Subject: [PATCH] add spec for CLI option "-W:no-deprecated" introduced in Ruby 2.7 --- command_line/dash_upper_w_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/command_line/dash_upper_w_spec.rb b/command_line/dash_upper_w_spec.rb index 31bb976ad2..90fc975157 100644 --- a/command_line/dash_upper_w_spec.rb +++ b/command_line/dash_upper_w_spec.rb @@ -18,3 +18,15 @@ 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('$; = ""', args: '2>&1') + result.should =~ /is deprecated/ + + result = ruby_exe('$; = ""', options: '-W:no-deprecated', args: '2>&1') + result.should == "" + end + end +end