# File test/pseudo_io.rb, line 68
    def gets(separator=$/)
      @closed and raise 'closed'
      if (@stream) then
        sep_len = separator.length
        if ((pos = @stream.index(separator)) && (pos + sep_len) < @stream.length) then
          string = @stream[0...(pos + sep_len)]
          @stream = @stream[(pos + sep_len)..-1]
          return string
        else
          return read_all
        end
      end

      nil
    end