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 | e76c47cc9533d5b3683b336d36a9db8560a73413 (patch) | |
| tree | 7891619dd466a38a28206b397d2761203a1ced4a /test/ruby | |
| parent | 941e421dd3a507843c03c2899ab80a8b7e58fee8 (diff) | |
| download | ruby-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/ruby')
| -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 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) |
