summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2020-01-21 08:37:44 +0900
committerNobuyoshi Nakada <[email protected]>2020-02-23 13:37:40 +0900
commit8a7e0aaaef3b19f90d6debe6781e4b3031f56237 (patch)
treee4c6fb0dd79b1d856cd8a200f550170114bbf30a /spec/ruby/core/string/shared
parent6298ec2875a6f1a1e75698c96ceac94362f20bcf (diff)
Warn non-nil `$/` [Feature #14240]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2920
Diffstat (limited to 'spec/ruby/core/string/shared')
-rw-r--r--spec/ruby/core/string/shared/each_line.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/ruby/core/string/shared/each_line.rb b/spec/ruby/core/string/shared/each_line.rb
index 843b123f57..d8c48054c4 100644
--- a/spec/ruby/core/string/shared/each_line.rb
+++ b/spec/ruby/core/string/shared/each_line.rb
@@ -84,7 +84,7 @@ describe :string_each_line, shared: true do
end
after :each do
- $/ = @before_separator
+ suppress_warning {$/ = @before_separator}
end
it "as the separator when none is given" do
@@ -96,10 +96,10 @@ describe :string_each_line, shared: true do
expected = []
str.send(@method, sep) { |x| expected << x }
- $/ = sep
+ suppress_warning {$/ = sep}
actual = []
- str.send(@method) { |x| actual << x }
+ suppress_warning {str.send(@method) { |x| actual << x }}
actual.should == expected
end