diff options
author | Benoit Daloze <[email protected]> | 2019-04-28 23:20:11 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-04-28 23:20:11 +0200 |
commit | 79671ec57e59091260a0bc3d40a31d31d9c72a94 (patch) | |
tree | 2f59a8727b8f63f9e79d50352fa4f78a7cc00234 /spec/ruby/language/string_spec.rb | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/language/string_spec.rb')
-rw-r--r-- | spec/ruby/language/string_spec.rb | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/spec/ruby/language/string_spec.rb b/spec/ruby/language/string_spec.rb index b198979d87..78ee5ff2c4 100644 --- a/spec/ruby/language/string_spec.rb +++ b/spec/ruby/language/string_spec.rb @@ -257,33 +257,31 @@ describe "Ruby String literals" do end -with_feature :encoding do - describe "Ruby String interpolation" do - it "creates a String having an Encoding compatible with all components" do - a = "\u3042" - b = "abc".encode("ascii-8bit") +describe "Ruby String interpolation" do + it "creates a String having an Encoding compatible with all components" do + a = "\u3042" + b = "abc".encode("ascii-8bit") - str = "#{a} x #{b}" + str = "#{a} x #{b}" - str.should == "\xe3\x81\x82\x20\x78\x20\x61\x62\x63".force_encoding("utf-8") - str.encoding.should == Encoding::UTF_8 - end + str.should == "\xe3\x81\x82\x20\x78\x20\x61\x62\x63".force_encoding("utf-8") + str.encoding.should == Encoding::UTF_8 + end - it "creates a String having the Encoding of the components when all are the same Encoding" do - a = "abc".force_encoding("euc-jp") - b = "def".force_encoding("euc-jp") - str = '"#{a} x #{b}"'.force_encoding("euc-jp") + it "creates a String having the Encoding of the components when all are the same Encoding" do + a = "abc".force_encoding("euc-jp") + b = "def".force_encoding("euc-jp") + str = '"#{a} x #{b}"'.force_encoding("euc-jp") - result = eval(str) - result.should == "\x61\x62\x63\x20\x78\x20\x64\x65\x66".force_encoding("euc-jp") - result.encoding.should == Encoding::EUC_JP - end + result = eval(str) + result.should == "\x61\x62\x63\x20\x78\x20\x64\x65\x66".force_encoding("euc-jp") + result.encoding.should == Encoding::EUC_JP + end - it "raises an Encoding::CompatibilityError if the Encodings are not compatible" do - a = "\u3042" - b = "\xff".force_encoding "ascii-8bit" + it "raises an Encoding::CompatibilityError if the Encodings are not compatible" do + a = "\u3042" + b = "\xff".force_encoding "ascii-8bit" - lambda { "#{a} #{b}" }.should raise_error(Encoding::CompatibilityError) - end + lambda { "#{a} #{b}" }.should raise_error(Encoding::CompatibilityError) end end |