summaryrefslogtreecommitdiff
path: root/spec/ruby/language/string_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2020-03-28 00:22:51 +0100
committerBenoit Daloze <[email protected]>2020-03-28 00:22:51 +0100
commitf234d51eaba861edea925eabb564a0bee41b96a0 ()
tree3334f36a91fe81ec704f2980ab169231f52c41d0 /spec/ruby/language/string_spec.rb
parent296f68816cf575b3ff920f92aec8a4109a7d81d4 (diff)
Update to ruby/spec@ec84479
-rw-r--r--spec/ruby/language/string_spec.rb22
1 files changed, 8 insertions, 14 deletions
@@ -260,24 +260,18 @@ describe "Ruby String literals" do
end
describe "Ruby String interpolation" do
- it "creates a String having an Encoding compatible with all components" do
- a = "\u3042"
- b = "abc".encode("binary")
-
- 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
- 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
it "raises an Encoding::CompatibilityError if the Encodings are not compatible" do