From 6d05967468ea58ba481259718f07b3cb5a386945 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 13 Nov 2020 13:17:24 +0100 Subject: Update to ruby/spec@b0b7f53 --- spec/ruby/core/string/chomp_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/ruby/core/string/chomp_spec.rb') diff --git a/spec/ruby/core/string/chomp_spec.rb b/spec/ruby/core/string/chomp_spec.rb index b3f64d7118..7a1118d534 100644 --- a/spec/ruby/core/string/chomp_spec.rb +++ b/spec/ruby/core/string/chomp_spec.rb @@ -55,6 +55,10 @@ describe "String#chomp" do $/ = "cdef" "abcdef".chomp.should == "ab" end + + it "removes one trailing newline for string with invalid encoding" do + "\xa0\xa1\n".chomp.should == "\xa0\xa1" + end end describe "when passed nil" do @@ -108,6 +112,10 @@ describe "String#chomp" do it "returns an empty String when self is empty" do "".chomp("").should == "" end + + it "removes one trailing newline for string with invalid encoding" do + "\xa0\xa1\n".chomp("").should == "\xa0\xa1" + end end describe "when passed '\\n'" do -- cgit v1.2.3