ruby-changes:55396
From: nobu <ko1@a...>
Date: Thu, 18 Apr 2019 18:56:09 +0900 (JST)
Subject: [ruby-changes:55396] nobu:r67604 (trunk): Suppress warnings
nobu 2019-04-18 18:56:03 +0900 (Thu, 18 Apr 2019) New Revision: 67604 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67604 Log: Suppress warnings Modified files: trunk/spec/ruby/core/string/split_spec.rb trunk/spec/ruby/library/English/English_spec.rb trunk/test/ruby/test_rubyoptions.rb Index: spec/ruby/core/string/split_spec.rb =================================================================== --- spec/ruby/core/string/split_spec.rb (revision 67603) +++ spec/ruby/core/string/split_spec.rb (revision 67604) @@ -66,6 +66,8 @@ describe "String#split with String" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/string/split_spec.rb#L66 it "defaults to $; when string isn't given or nil" do begin + verbose = $VERBOSE + $VERBOSE = nil old_fs = $; [",", ":", "", "XY", nil].each do |fs| @@ -84,6 +86,7 @@ describe "String#split with String" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/string/split_spec.rb#L86 end ensure $; = old_fs + $VERBOSE = verbose end end @@ -239,6 +242,8 @@ describe "String#split with Regexp" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/string/split_spec.rb#L242 it "defaults to $; when regexp isn't given or nil" do begin + verbose = $VERBOSE + $VERBOSE = nil old_fs = $; [/,/, /:/, //, /XY/, /./].each do |fs| @@ -257,6 +262,7 @@ describe "String#split with Regexp" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/string/split_spec.rb#L262 end ensure $; = old_fs + $VERBOSE = verbose end end Index: spec/ruby/library/English/English_spec.rb =================================================================== --- spec/ruby/library/English/English_spec.rb (revision 67603) +++ spec/ruby/library/English/English_spec.rb (revision 67604) @@ -25,18 +25,18 @@ describe "English" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/English/English_spec.rb#L25 it "aliases $FS to $;" do original = $; - $; = "," + suppress_warning {$; = ","} $FS.should_not be_nil $FS.should == $; - $; = original + suppress_warning {$; = original} end it "aliases $FIELD_SEPARATOR to $;" do original = $; - $; = "," + suppress_warning {$; = ","} $FIELD_SEPARATOR.should_not be_nil $FIELD_SEPARATOR.should == $; - $; = original + suppress_warning {$; = original} end it "aliases $OFS to $," do Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 67603) +++ test/ruby/test_rubyoptions.rb (revision 67604) @@ -253,7 +253,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L253 end def test_autosplit - assert_in_out_err(%w(-an -F: -e) + ["p $F"], "foo:bar:baz\nqux:quux:quuux\n", + assert_in_out_err(%w(-W0 -an -F: -e) + ["p $F"], "foo:bar:baz\nqux:quux:quuux\n", ['["foo", "bar", "baz\n"]', '["qux", "quux", "quuux\n"]'], []) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/