mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7de852d
This commit is contained in:
parent
994833085a
commit
79671ec57e
135 changed files with 4415 additions and 4885 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue