diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-21 08:37:44 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-23 13:37:40 +0900 |
commit | 8a7e0aaaef3b19f90d6debe6781e4b3031f56237 (patch) | |
tree | e4c6fb0dd79b1d856cd8a200f550170114bbf30a /spec/ruby/core/string/chomp_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/core/string/chomp_spec.rb')
-rw-r--r-- | spec/ruby/core/string/chomp_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/string/chomp_spec.rb b/spec/ruby/core/string/chomp_spec.rb index 20a0925959..a893bf7759 100644 --- a/spec/ruby/core/string/chomp_spec.rb +++ b/spec/ruby/core/string/chomp_spec.rb @@ -6,11 +6,13 @@ describe "String#chomp" do describe "when passed no argument" do before do # Ensure that $/ is set to the default value + @verbose, $VERBOSE = $VERBOSE, nil @dollar_slash, $/ = $/, "\n" end after do $/ = @dollar_slash + $VERBOSE = @verbose end it "does not modify a String with no trailing carriage return or newline" do @@ -179,11 +181,13 @@ describe "String#chomp!" do describe "when passed no argument" do before do # Ensure that $/ is set to the default value + @verbose, $VERBOSE = $VERBOSE, nil @dollar_slash, $/ = $/, "\n" end after do $/ = @dollar_slash + $VERBOSE = @verbose end it "modifies self" do @@ -350,11 +354,13 @@ end describe "String#chomp" do before :each do + @verbose, $VERBOSE = $VERBOSE, nil @before_separator = $/ end after :each do $/ = @before_separator + $VERBOSE = @verbose end it "does not modify a multi-byte character" do @@ -379,11 +385,13 @@ end describe "String#chomp!" do before :each do + @verbose, $VERBOSE = $VERBOSE, nil @before_separator = $/ end after :each do $/ = @before_separator + $VERBOSE = @verbose end it "returns nil when the String is not modified" do |