diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
commit | 79671ec57e59091260a0bc3d40a31d31d9c72a94 (patch) | |
tree | 2f59a8727b8f63f9e79d50352fa4f78a7cc00234 /spec/ruby/core/string/chop_spec.rb | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) | |
download | ruby-79671ec57e59091260a0bc3d40a31d31d9c72a94.tar.gz |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/core/string/chop_spec.rb')
-rw-r--r-- | spec/ruby/core/string/chop_spec.rb | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb index 033a11a95b..f33da3ecc4 100644 --- a/spec/ruby/core/string/chop_spec.rb +++ b/spec/ruby/core/string/chop_spec.rb @@ -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 |