From aeaeb4b0686b01a4a56998a4b7d87da470a57209 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Oct 2017 06:25:39 +0000 Subject: stringio.c: write multiple arguments * ext/stringio/stringio.c (strio_write_m): make StringIO#write accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/stringio/test_stringio.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/stringio') diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 7b9b1105d1..f97ac877fc 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -206,6 +206,16 @@ class TestStringIO < Test::Unit::TestCase } end + def test_write_with_multiple_arguments + s = "" + f = StringIO.new(s, "w") + f.write("foo", "bar") + f.close + assert_equal("foobar", s) + ensure + f.close unless f.closed? + end + def test_set_encoding bug10285 = '[ruby-core:65240] [Bug #10285]' f = StringIO.new() -- cgit v1.2.3