diff options
-rw-r--r-- | ext/mwrap/mwrap.c | 1 | ||||
-rw-r--r-- | test/test_mwrap.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/ext/mwrap/mwrap.c b/ext/mwrap/mwrap.c index 3f59f11..c160e33 100644 --- a/ext/mwrap/mwrap.c +++ b/ext/mwrap/mwrap.c @@ -346,6 +346,7 @@ static VALUE mwrap_dump(int argc, VALUE * argv, VALUE mod) io = *((VALUE *)dlsym(RTLD_DEFAULT, "rb_stderr")); a.min = NIL_P(min) ? 0 : NUM2SIZET(min); + io = rb_io_get_io(io); io = rb_io_get_write_io(io); GetOpenFile(io, fptr); a.fp = rb_io_stdio_file(fptr); diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb index 3de9c1b..d76e4da 100644 --- a/test/test_mwrap.rb +++ b/test/test_mwrap.rb @@ -155,4 +155,8 @@ class TestMwrap < Test::Unit::TestCase warn Benchmark::Tms::CAPTION warn r.read end if ENV['BENCHMARK'] + + def test_mwrap_dump_check + assert_raise(TypeError) { Mwrap.dump(:bogus) } + end end |