You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_pair.rb
    path of file: ./repos/ruby/test/openssl
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require_relative 'util
    
  def test_read_with_outbuf
    ssl_pair { |s1, s2|
      s1.write("abc\n")
      buf = String.new
      ret = s2.read(2, buf)
      assert_same ret, buf
      assert_equal "ab", ret

      buf = +"garbage"
      ret = s2.read(2, buf)
      assert_same ret, buf
      assert_equal "c\n", ret

      buf = +"garbage"
      assert_equal :wait_readable, s2.read_nonblock(100, buf, exception: false)
      assert_equal "", buf

      s1.close
      buf = +"garbage"
      assert_equal nil, s2.read(100, buf)
      assert_equal "", buf
    }
  end