diff options
Diffstat (limited to 'spec/ruby/command_line/rubyopt_spec.rb')
-rw-r--r-- | spec/ruby/command_line/rubyopt_spec.rb | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/spec/ruby/command_line/rubyopt_spec.rb b/spec/ruby/command_line/rubyopt_spec.rb index a2b817bad8..18a5959b18 100644 --- a/spec/ruby/command_line/rubyopt_spec.rb +++ b/spec/ruby/command_line/rubyopt_spec.rb @@ -11,72 +11,70 @@ describe "Processing RUBYOPT" do it "adds the -I path to $LOAD_PATH" do ENV["RUBYOPT"] = "-Ioptrubyspecincl" - result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", escape: true) + result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)") result.chomp[-15..-1].should == "optrubyspecincl" end it "sets $DEBUG to true for '-d'" do ENV["RUBYOPT"] = '-d' command = %[puts "value of $DEBUG is \#{$DEBUG}"] - result = ruby_exe(command, escape: true, args: "2>&1") + result = ruby_exe(command, args: "2>&1") result.should =~ /value of \$DEBUG is true/ end guard -> { not CROSS_COMPILING } do it "prints the version number for '-v'" do ENV["RUBYOPT"] = '-v' - ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION + ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "") end it "ignores whitespace around the option" do ENV["RUBYOPT"] = ' -v ' - ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION + ruby_exe("")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "") end end it "sets $VERBOSE to true for '-w'" do ENV["RUBYOPT"] = '-w' - ruby_exe("p $VERBOSE", escape: true).chomp.should == "true" + ruby_exe("p $VERBOSE").chomp.should == "true" end it "sets $VERBOSE to true for '-W'" do ENV["RUBYOPT"] = '-W' - ruby_exe("p $VERBOSE", escape: true).chomp.should == "true" + ruby_exe("p $VERBOSE").chomp.should == "true" end it "sets $VERBOSE to nil for '-W0'" do ENV["RUBYOPT"] = '-W0' - ruby_exe("p $VERBOSE", escape: true).chomp.should == "nil" + ruby_exe("p $VERBOSE").chomp.should == "nil" end it "sets $VERBOSE to false for '-W1'" do ENV["RUBYOPT"] = '-W1' - ruby_exe("p $VERBOSE", escape: true).chomp.should == "false" + ruby_exe("p $VERBOSE").chomp.should == "false" end it "sets $VERBOSE to true for '-W2'" do ENV["RUBYOPT"] = '-W2' - ruby_exe("p $VERBOSE", escape: true).chomp.should == "true" + ruby_exe("p $VERBOSE").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 |