summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio/shared
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-21 08:37:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-23 13:37:40 +0900
commit8a7e0aaaef3b19f90d6debe6781e4b3031f56237 (patch)
treee4c6fb0dd79b1d856cd8a200f550170114bbf30a /spec/ruby/library/stringio/shared
parent6298ec2875a6f1a1e75698c96ceac94362f20bcf (diff)
Warn non-nil `$/` [Feature #14240]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2920
Diffstat (limited to 'spec/ruby/library/stringio/shared')
-rw-r--r--spec/ruby/library/stringio/shared/each.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/ruby/library/stringio/shared/each.rb b/spec/ruby/library/stringio/shared/each.rb
index c08d40344c..14b0a013b3 100644
--- a/spec/ruby/library/stringio/shared/each.rb
+++ b/spec/ruby/library/stringio/shared/each.rb
@@ -71,11 +71,12 @@ describe :stringio_each_no_arguments, shared: true do
it "uses $/ as the default line separator" do
seen = []
begin
- old_rs, $/ = $/, " "
+ old_rs = $/
+ suppress_warning {$/ = " "}
@io.send(@method) {|s| seen << s }
seen.should eql(["a ", "b ", "c ", "d ", "e\n1 ", "2 ", "3 ", "4 ", "5"])
ensure
- $/ = old_rs
+ suppress_warning {$/ = old_rs}
end
end