Class: TCPSocket
- Inherits:
-
Object
- Object
- TCPSocket
- Defined in:
- lib/capybara/core_ext/tcp_socket.rb
Class Method Summary collapse
- .wait_for_service_termination_with_timeout(options) ⇒ Object
- .wait_for_service_with_timeout(options) ⇒ Object
Class Method Details
.wait_for_service_termination_with_timeout(options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/capybara/core_ext/tcp_socket.rb', line 14 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 |
.wait_for_service_with_timeout(options) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/capybara/core_ext/tcp_socket.rb', line 2 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 |