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 2019-04-28 23:20:11 +02:00
parent 994833085a
commit 79671ec57e
135 changed files with 4415 additions and 4885 deletions

View file

@ -27,19 +27,17 @@ describe "String#chop" do
"abc\r\n\r\n".chop.should == "abc\r\n"
end
with_feature :encoding do
it "removes a multi-byte character" do
"あれ".chop.should == ""
end
it "removes a multi-byte character" do
"あれ".chop.should == ""
end
it "removes the final carriage return, newline from a multibyte String" do
"あれ\r\n".chop.should == "あれ"
end
it "removes the final carriage return, newline from a multibyte String" do
"あれ\r\n".chop.should == "あれ"
end
it "removes the final carriage return, newline from a non-ASCII String" do
str = "abc\r\n".encode "utf-32be"
str.chop.should == "abc".encode("utf-32be")
end
it "removes the final carriage return, newline from a non-ASCII String" do
str = "abc\r\n".encode "utf-32be"
str.chop.should == "abc".encode("utf-32be")
end
it "returns an empty string when applied to an empty string" do
@ -91,19 +89,17 @@ describe "String#chop!" do
"abc\r\n\r\n".chop!.should == "abc\r\n"
end
with_feature :encoding do
it "removes a multi-byte character" do
"あれ".chop!.should == ""
end
it "removes a multi-byte character" do
"あれ".chop!.should == ""
end
it "removes the final carriage return, newline from a multibyte String" do
"あれ\r\n".chop!.should == "あれ"
end
it "removes the final carriage return, newline from a multibyte String" do
"あれ\r\n".chop!.should == "あれ"
end
it "removes the final carriage return, newline from a non-ASCII String" do
str = "abc\r\n".encode "utf-32be"
str.chop!.should == "abc".encode("utf-32be")
end
it "removes the final carriage return, newline from a non-ASCII String" do
str = "abc\r\n".encode "utf-32be"
str.chop!.should == "abc".encode("utf-32be")
end
it "returns self if modifications were made" do