summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 06:25:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-23 06:25:39 +0000
commitaeaeb4b0686b01a4a56998a4b7d87da470a57209 (patch)
tree4100bc0e185938ce00c399a602e8e4f42f0bbdbb /test/stringio
parent5682bc6ac547af13e2d2a4100c7d82995c2749f4 (diff)
downloadruby-aeaeb4b0686b01a4a56998a4b7d87da470a57209.tar.gz
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
Diffstat (limited to 'test/stringio')
-rw-r--r--test/stringio/test_stringio.rb10
1 files changed, 10 insertions, 0 deletions
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()