summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-25 10:41:16 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-25 10:41:16 +0000
commite87fb88be844f0fae736768846954b6f6f7dc7c3 (patch)
treecbe2ab069e40b5b7f3217ce95b793426b303a305 /spec/ruby/library/stringio
parente59bf54b3a88d0465cca021afae7dc05b6db57a7 (diff)
Update to ruby/spec@241f9e7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/stringio')
-rw-r--r--spec/ruby/library/stringio/external_encoding_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/library/stringio/external_encoding_spec.rb b/spec/ruby/library/stringio/external_encoding_spec.rb
index 9c3d4041e5..6c5edb1713 100644
--- a/spec/ruby/library/stringio/external_encoding_spec.rb
+++ b/spec/ruby/library/stringio/external_encoding_spec.rb
@@ -8,6 +8,12 @@ describe "StringIO#external_encoding" do
io.external_encoding.should == Encoding::EUC_JP
end
+ it "changes to match string if string's encoding is changed" do
+ io = StringIO.new
+ io.string.force_encoding(Encoding::EUC_JP)
+ io.external_encoding.should == Encoding::EUC_JP
+ end
+
it "does not set the encoding of its buffer string if the string is frozen" do
str = "foo".freeze
enc = str.encoding