diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
commit | 45cf4f218728a15eb36d14a6c9912086525f5e3f (patch) | |
tree | 2aa93fadcb904c226f722dde47827098b87a9846 /spec/ruby/command_line | |
parent | 6ae81d49b52563a6720d666a6118ffa6e484f398 (diff) | |
download | ruby-45cf4f218728a15eb36d14a6c9912086525f5e3f.tar.gz |
Update to ruby/spec@3affe1e
Diffstat (limited to 'spec/ruby/command_line')
-rw-r--r-- | spec/ruby/command_line/dash_upper_w_spec.rb | 33 | ||||
-rw-r--r-- | spec/ruby/command_line/dash_w_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb | 2 | ||||
-rw-r--r-- | spec/ruby/command_line/rubyopt_spec.rb | 30 |
4 files changed, 32 insertions, 39 deletions
diff --git a/spec/ruby/command_line/dash_upper_w_spec.rb b/spec/ruby/command_line/dash_upper_w_spec.rb index cbb040a8dd..4019510d42 100644 --- a/spec/ruby/command_line/dash_upper_w_spec.rb +++ b/spec/ruby/command_line/dash_upper_w_spec.rb @@ -19,29 +19,26 @@ describe "The -W command line option with 2" do it_behaves_like :command_line_verbose, "-W2" end -# Regarding the defaults, see core/warning/element_reference_spec.rb -ruby_version_is "2.7" do - describe "The -W command line option with :deprecated" do - it "enables deprecation warnings" do - ruby_exe('p Warning[:deprecated]', options: '-W:deprecated').should == "true\n" - end +describe "The -W command line option with :deprecated" do + it "enables deprecation warnings" do + ruby_exe('p Warning[:deprecated]', options: '-W:deprecated').should == "true\n" end +end - describe "The -W command line option with :no-deprecated" do - it "suppresses deprecation warnings" do - ruby_exe('p Warning[:deprecated]', options: '-w -W:no-deprecated').should == "false\n" - end +describe "The -W command line option with :no-deprecated" do + it "suppresses deprecation warnings" do + ruby_exe('p Warning[:deprecated]', options: '-w -W:no-deprecated').should == "false\n" end +end - describe "The -W command line option with :experimental" do - it "enables experimental warnings" do - ruby_exe('p Warning[:experimental]', options: '-W:experimental').should == "true\n" - end +describe "The -W command line option with :experimental" do + it "enables experimental warnings" do + ruby_exe('p Warning[:experimental]', options: '-W:experimental').should == "true\n" end +end - describe "The -W command line option with :no-experimental" do - it "suppresses experimental warnings" do - ruby_exe('p Warning[:experimental]', options: '-w -W:no-experimental').should == "false\n" - end +describe "The -W command line option with :no-experimental" do + it "suppresses experimental warnings" do + ruby_exe('p Warning[:experimental]', options: '-w -W:no-experimental').should == "false\n" end end diff --git a/spec/ruby/command_line/dash_w_spec.rb b/spec/ruby/command_line/dash_w_spec.rb index c262df12cc..f310dca3ed 100644 --- a/spec/ruby/command_line/dash_w_spec.rb +++ b/spec/ruby/command_line/dash_w_spec.rb @@ -4,9 +4,7 @@ require_relative 'shared/verbose' describe "The -w command line option" do it_behaves_like :command_line_verbose, "-w" - ruby_version_is "2.7" do - it "enables both deprecated and experimental warnings" do - ruby_exe('p Warning[:deprecated]; p Warning[:experimental]', options: '-w').should == "true\ntrue\n" - end + it "enables both deprecated and experimental warnings" do + ruby_exe('p Warning[:deprecated]; p Warning[:experimental]', options: '-w').should == "true\ntrue\n" end end diff --git a/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb b/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb index 074092c9d9..f5547a5bae 100644 --- a/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb +++ b/spec/ruby/command_line/fixtures/freeze_flag_two_literals.rb @@ -1 +1 @@ -p "abc".object_id == "abc".object_id +p "abc".equal?("abc") diff --git a/spec/ruby/command_line/rubyopt_spec.rb b/spec/ruby/command_line/rubyopt_spec.rb index a2b817bad8..bbea4d557d 100644 --- a/spec/ruby/command_line/rubyopt_spec.rb +++ b/spec/ruby/command_line/rubyopt_spec.rb @@ -59,24 +59,22 @@ 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 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('case 0; in a; end', args: '2>&1') - result.should == "" - end + it "suppresses experimental warnings for '-W:no-experimental'" do + ENV["RUBYOPT"] = '-W:no-experimental' + result = ruby_exe('case 0; in a; end', 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('case ($; = ""); in a; end', 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('case ($; = ""); in a; end', args: '2>&1') + result.should == "" end it "requires the file for '-r'" do |