Method: TCPSocket.wait_for_service_with_timeout
- Defined in:
- lib/webrat/core_extensions/tcp_socket.rb
.wait_for_service_with_timeout(options) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/webrat/core_extensions/tcp_socket.rb', line 3 def self.wait_for_service_with_timeout() start_time = Time.now until listening_service?() verbose_wait if [:timeout] && (Time.now > start_time + [:timeout]) raise SocketError.new("Socket did not open within #{[:timeout]} seconds") end end end |