summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/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/core/io/shared
parent6298ec2875a6f1a1e75698c96ceac94362f20bcf (diff)
Warn non-nil `$/` [Feature #14240]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2920
Diffstat (limited to 'spec/ruby/core/io/shared')
-rw-r--r--spec/ruby/core/io/shared/each.rb4
-rw-r--r--spec/ruby/core/io/shared/readlines.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/io/shared/each.rb b/spec/ruby/core/io/shared/each.rb
index 0b2dfa3548..91766fbe03 100644
--- a/spec/ruby/core/io/shared/each.rb
+++ b/spec/ruby/core/io/shared/each.rb
@@ -168,12 +168,12 @@ describe :io_each_default_separator, shared: true do
before :each do
@io = IOSpecs.io_fixture "lines.txt"
ScratchPad.record []
- @sep, $/ = $/, " "
+ suppress_warning {@sep, $/ = $/, " "}
end
after :each do
@io.close if @io
- $/ = @sep
+ suppress_warning {$/ = @sep}
end
it "uses $/ as the default line separator" do
diff --git a/spec/ruby/core/io/shared/readlines.rb b/spec/ruby/core/io/shared/readlines.rb
index de803f42e5..339684a5d4 100644
--- a/spec/ruby/core/io/shared/readlines.rb
+++ b/spec/ruby/core/io/shared/readlines.rb
@@ -60,11 +60,11 @@ describe :io_readlines_options_19, shared: true do
end
after :each do
- $/ = @sep
+ suppress_warning {$/ = @sep}
end
it "defaults to $/ as the separator" do
- $/ = " "
+ suppress_warning {$/ = " "}
result = IO.send(@method, @name, 10, &@object)
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_space_separator_limit
end