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/insert_spec.rb | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) | |
download | ruby-79671ec57e59091260a0bc3d40a31d31d9c72a94.tar.gz |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/core/string/insert_spec.rb')
-rw-r--r-- | spec/ruby/core/string/insert_spec.rb | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb index 2c72bb5ffd..d5b9026f3d 100644 --- a/spec/ruby/core/string/insert_spec.rb +++ b/spec/ruby/core/string/insert_spec.rb @@ -63,22 +63,20 @@ describe "String#insert with index, other" do lambda { str.insert(4, 'X') }.should raise_error(frozen_error_class) end - with_feature :encoding do - it "inserts a character into a multibyte encoded string" do - "ありがとう".insert(1, 'ü').should == "あüりがとう" - end - - it "returns a String in the compatible encoding" do - str = "".force_encoding(Encoding::US_ASCII) - str.insert(0, "ありがとう") - str.encoding.should == Encoding::UTF_8 - end - - it "raises an Encoding::CompatibilityError if the encodings are incompatible" do - pat = "ア".encode Encoding::EUC_JP - lambda do - "あれ".insert 0, pat - end.should raise_error(Encoding::CompatibilityError) - end + it "inserts a character into a multibyte encoded string" do + "ありがとう".insert(1, 'ü').should == "あüりがとう" + end + + it "returns a String in the compatible encoding" do + str = "".force_encoding(Encoding::US_ASCII) + str.insert(0, "ありがとう") + str.encoding.should == Encoding::UTF_8 + end + + it "raises an Encoding::CompatibilityError if the encodings are incompatible" do + pat = "ア".encode Encoding::EUC_JP + lambda do + "あれ".insert 0, pat + end.should raise_error(Encoding::CompatibilityError) end end |