summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 17:09:56 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 17:09:56 +0000
commite76c47cc9533d5b3683b336d36a9db8560a73413 (patch)
tree7891619dd466a38a28206b397d2761203a1ced4a /test
parent941e421dd3a507843c03c2899ab80a8b7e58fee8 (diff)
downloadruby-e76c47cc9533d5b3683b336d36a9db8560a73413.tar.gz
ruby-e76c47cc9533d5b3683b336d36a9db8560a73413.tar.xz
ruby-e76c47cc9533d5b3683b336d36a9db8560a73413.zip
* io.c (rb_io_initialize): accept hash argument.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io_m17n.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 46b7954a9..d39e03075 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)