diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-01-21 08:37:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-02-23 13:37:40 +0900 |
commit | 8a7e0aaaef3b19f90d6debe6781e4b3031f56237 (patch) | |
tree | e4c6fb0dd79b1d856cd8a200f550170114bbf30a /spec/ruby/library/stringio/readlines_spec.rb | |
parent | 6298ec2875a6f1a1e75698c96ceac94362f20bcf (diff) |
Warn non-nil `$/` [Feature #14240]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2920
Diffstat (limited to 'spec/ruby/library/stringio/readlines_spec.rb')
-rw-r--r-- | spec/ruby/library/stringio/readlines_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/ruby/library/stringio/readlines_spec.rb b/spec/ruby/library/stringio/readlines_spec.rb index 7f9f9f5846..4b007787e2 100644 --- a/spec/ruby/library/stringio/readlines_spec.rb +++ b/spec/ruby/library/stringio/readlines_spec.rb @@ -51,10 +51,11 @@ describe "StringIO#readlines when passed no argument" do it "returns an Array containing lines based on $/" do begin - old_sep, $/ = $/, " " + old_sep = $/; + suppress_warning {$/ = " "} @io.readlines.should == ["this ", "is\nan ", "example\nfor ", "StringIO#readlines"] ensure - $/ = old_sep + suppress_warning {$/ = old_sep} end end |