diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-21 17:09:56 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-21 17:09:56 +0000 |
commit | dd7cf02eab10e8feb7cb4324265d6ecd81a759df (patch) | |
tree | 7891619dd466a38a28206b397d2761203a1ced4a /test | |
parent | a0cc5b19b7fa4207496a74d2ef8f39480eac44b5 (diff) | |
download | ruby-dd7cf02eab10e8feb7cb4324265d6ecd81a759df.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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) |