summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/stringio/test_stringio.rb')
-rw-r--r--test/stringio/test_stringio.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 663a33be27..a99ccf4302 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -797,6 +797,18 @@ class TestStringIO < Test::Unit::TestCase
end
end
+ def test_binary_encoding_read_and_default_internal
+ verbose, $VERBOSE = $VERBOSE, nil
+ default_internal = Encoding.default_internal
+ Encoding.default_internal = Encoding::UTF_8
+ $VERBOSE = verbose
+ assert_equal Encoding::BINARY, StringIO.new("Hello".b).read.encoding
+ ensure
+ $VERBOSE = nil
+ Encoding.default_internal = default_internal
+ $VERBOSE = verbose
+ end
+
def assert_string(content, encoding, str, mesg = nil)
assert_equal([content, encoding], [str, str.encoding], mesg)
end