summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 09:23:15 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 09:23:15 +0000
commitcfdb3f5c264ebf1dde0845015b567b2aded894de (patch)
treeae3b8e7d7548716e2b012b8b8b9a7a817c514f2a /test
parent2b0014ca250ba6defec37420025ede253d485063 (diff)
merge revision(s) 53435: [Backport #11945]
* ext/stringio/stringio.c (strio_binmode): implement to set encoding * test/stringio/test_stringio.rb (test_binmode): new test [ruby-core:72699] [Bug #11945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@53927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 07d89d16e1..6d0bd5c803 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -586,4 +586,13 @@ class TestStringIO < Test::Unit::TestCase
assert_raise(ArgumentError, "[ruby-dev:43392]") { StringIO.new.each_line(0){} }
assert_raise(ArgumentError, "[ruby-dev:43392]") { StringIO.new.each_line("a",0){} }
end
+
+ def test_binmode
+ s = StringIO.new
+ s.set_encoding('utf-8')
+ assert_same s, s.binmode
+
+ bug_11945 = '[ruby-core:72699] [Bug #11945]'
+ assert_equal Encoding::ASCII_8BIT, s.external_encoding, bug_11945
+ end
end