module Cuukie::Client

Public Instance Methods

ping_at(port) click to toggle source
# File lib/cuukie/client.rb, line 5
def ping_at(port)
  RestClient.get "http://localhost:#{port}/ping"
end
stop_server_at(port) click to toggle source
# File lib/cuukie/client.rb, line 18
def stop_server_at(port)
  # the server dies without replying, so we expect an error here
  RestClient.delete "http://localhost:#{port}/"
rescue
end
wait_for_server_at(port) click to toggle source
# File lib/cuukie/client.rb, line 9
def wait_for_server_at(port)
  loop do
    begin
      ping_at port
      return
    rescue; end
  end
end