diff options
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | test/ruby/test_io.rb | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -1590,7 +1590,7 @@ io_fwritev(int argc, VALUE *argv, rb_io_t *fptr) tmp_array = ALLOCV_N(VALUE, v2, argc); for (i = 0; i < argc; i++) { - str = argv[i]; + str = rb_obj_as_string(argv[i]); converted = 0; str = do_writeconv(str, fptr, &converted); if (converted) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 7f86b4e..0bedebf 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1270,6 +1270,10 @@ class TestIO < Test::Unit::TestCase end end + def test_write_with_multiple_nonstring_arguments + assert_in_out_err([], "STDOUT.write(:foo, :bar)", ["foobar"]) + end + def test_write_non_writable with_pipe do |r, w| assert_raise(IOError) do |