From cfa154fa577d4e4d0f551b1b3ed9502d24963ec0 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 23 Oct 2017 16:47:21 +0900 Subject: buffering: let #write accept multiple arguments As of Ruby 2.5, IO#write accepts multiple input strings and writes them at once[1]. Follow that. [1] https://bugs.ruby-lang.org/issues/9323 --- test/test_pair.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/test_pair.rb b/test/test_pair.rb index 55b62321..29d5c9bb 100644 --- a/test/test_pair.rb +++ b/test/test_pair.rb @@ -362,6 +362,15 @@ module OpenSSL::TestPairM } end + def test_write_multiple_arguments + ssl_pair {|s1, s2| + str1 = "foo"; str2 = "bar" + assert_equal 6, s1.write(str1, str2) + s1.close + assert_equal "foobar", s2.read + } + end + def test_partial_tls_record_read_nonblock ssl_pair { |s1, s2| # the beginning of a TLS record -- cgit v1.2.3