Sha256: 6086adc653db2a357a4c028128a538d28185ad5da949c8b0686e4c12796676a6

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

class TCPSocket

  def self.wait_for_service_with_timeout(options)
    start_time = Time.now

    until listening_service?(options)
      verbose_wait

      if options[:timeout] && (Time.now > start_time + options[:timeout])
        raise SocketError.new("Socket did not open within #{options[:timeout]} seconds")
      end
    end
  end

  def self.wait_for_service_termination_with_timeout(options)
    start_time = Time.now

    while listening_service?(options)
      verbose_wait

      if options[:timeout] && (Time.now > start_time + options[:timeout])
        raise SocketError.new("Socket did not terminate within #{options[:timeout]} seconds")
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mkuklis-webrat-0.6.rc1 lib/webrat/core_extensions/tcp_socket.rb