Method: TCPSocket.wait_for_service_termination_with_timeout
- Defined in:
- lib/webrat/core_extensions/tcp_socket.rb
.wait_for_service_termination_with_timeout(options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/webrat/core_extensions/tcp_socket.rb', line 15 def self.wait_for_service_termination_with_timeout() start_time = Time.now while listening_service?() verbose_wait if [:timeout] && (Time.now > start_time + [:timeout]) raise SocketError.new("Socket did not terminate within #{[:timeout]} seconds") end end end |