From dd7cf02eab10e8feb7cb4324265d6ecd81a759df Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 21 Aug 2008 17:09:56 +0000 Subject: * io.c (rb_io_initialize): accept hash argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io_m17n.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 46b7954a91..d39e03075f 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -206,6 +206,19 @@ EOT } end + def test_io_new_enc + with_tmpdir { + generate_file("tmp", "\xa1") + fd = IO.sysopen("tmp") + f = IO.new(fd, "r:sjis") + begin + assert_equal(Encoding::Shift_JIS, f.read.encoding) + ensure + f.close + end + } + end + def test_stdin assert_equal(Encoding.default_external, STDIN.external_encoding) assert_equal(nil, STDIN.internal_encoding) -- cgit v1.2.3