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_pty.rb
    path of file: ./repos/ruby/test
    
    the code of the file until where you have to start completion: # frozen_string_literal: false
require 'test/unit'
require 'shellwords'
require 'tmpdir'

begin
  require 'pty'
rescue LoadError
    
  def test_close_master
    PTY.open {|master, slave|
      master.close
      assert_raise(EOFError) { slave.readpartial(10) }
    }
  rescue RuntimeError
    omit $!
  end