summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/ruby/core/string/split_spec.rb6
-rw-r--r--spec/ruby/library/English/English_spec.rb8
-rw-r--r--test/ruby/test_rubyoptions.rb2
3 files changed, 11 insertions, 5 deletions
diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb
index 0c82ef8c58..7d5a591790 100644
--- a/spec/ruby/core/string/split_spec.rb
+++ b/spec/ruby/core/string/split_spec.rb
@@ -66,6 +66,8 @@ describe "String#split with String" do
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
end
ensure
$; = old_fs
+ $VERBOSE = verbose
end
end
@@ -239,6 +242,8 @@ describe "String#split with Regexp" do
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
end
ensure
$; = old_fs
+ $VERBOSE = verbose
end
end
diff --git a/spec/ruby/library/English/English_spec.rb b/spec/ruby/library/English/English_spec.rb
index 32941924eb..45ce7ab322 100644
--- a/spec/ruby/library/English/English_spec.rb
+++ b/spec/ruby/library/English/English_spec.rb
@@ -25,18 +25,18 @@ describe "English" do
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
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index aeef074aaa..0956d6ef78 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -253,7 +253,7 @@ class TestRubyOptions < Test::Unit::TestCase
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