aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/stringio/puts_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/puts_spec.rb')
-rw-r--r--spec/ruby/library/stringio/puts_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/ruby/library/stringio/puts_spec.rb b/spec/ruby/library/stringio/puts_spec.rb
index 2d3db25c5f..a9f289a5a5 100644
--- a/spec/ruby/library/stringio/puts_spec.rb
+++ b/spec/ruby/library/stringio/puts_spec.rb
@@ -30,11 +30,12 @@ describe "StringIO#puts when passed an Array" do
it "does not honor the global output record separator $\\" do
begin
- old_rs, $\ = $\, "test"
+ old_rs = $\
+ suppress_warning {$\ = "test"}
@io.puts([1, 2, 3, 4])
@io.string.should == "1\n2\n3\n4\n"
ensure
- $\ = old_rs
+ suppress_warning {$\ = old_rs}
end
end
@@ -68,11 +69,12 @@ describe "StringIO#puts when passed 1 or more objects" do
it "does not honor the global output record separator $\\" do
begin
- old_rs, $\ = $\, "test"
+ old_rs = $\
+ suppress_warning {$\ = "test"}
@io.puts(1, 2, 3, 4)
@io.string.should == "1\n2\n3\n4\n"
ensure
- $\ = old_rs
+ suppress_warning {$\ = old_rs}
end
end
@@ -117,11 +119,12 @@ describe "StringIO#puts when passed no arguments" do
it "does not honor the global output record separator $\\" do
begin
- old_rs, $\ = $\, "test"
+ old_rs = $\
+ suppress_warning {$\ = "test"}
@io.puts
@io.string.should == "\n"
ensure
- $\ = old_rs
+ suppress_warning {$\ = old_rs}
end
end
end