summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio/print_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/print_spec.rb')
-rw-r--r--spec/ruby/library/stringio/print_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/ruby/library/stringio/print_spec.rb b/spec/ruby/library/stringio/print_spec.rb
index d0f07d1e50..6ac6430900 100644
--- a/spec/ruby/library/stringio/print_spec.rb
+++ b/spec/ruby/library/stringio/print_spec.rb
@@ -39,13 +39,14 @@ describe "StringIO#print" do
end
it "honors the output record separator global" do
- old_rs, $\ = $\, 'x'
+ old_rs = $\
+ suppress_warning {$\ = 'x'}
begin
@io.print(5, 6, 7, 8)
@io.string.should == '5678xle'
ensure
- $\ = old_rs
+ suppress_warning {$\ = old_rs}
end
end
@@ -58,13 +59,14 @@ describe "StringIO#print" do
end
it "correctly updates the current position when honoring the output record separator global" do
- old_rs, $\ = $\, 'x'
+ old_rs = $\
+ suppress_warning {$\ = 'x'}
begin
@io.print(5, 6, 7, 8)
@io.pos.should eql(5)
ensure
- $\ = old_rs
+ suppress_warning {$\ = old_rs}
end
end
end