1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-11-13 13:17:24 +01:00
parent acbe7aa197
commit 6d05967468
27 changed files with 703 additions and 76 deletions

View file

@ -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