From 79671ec57e59091260a0bc3d40a31d31d9c72a94 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 28 Apr 2019 23:20:11 +0200 Subject: Update to ruby/spec@7de852d --- spec/ruby/language/string_spec.rb | 42 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'spec/ruby/language/string_spec.rb') 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 -- cgit v1.2.3