spec/spec_helper.rb in cuukie-0.1.4 vs spec/spec_helper.rb in cuukie-0.2.0

- old
+ new

@@ -1,6 +1,7 @@ require 'bundler/setup' +require 'cuukie' def start_process(command) Process.detach fork { exec command } end @@ -21,17 +22,21 @@ def html GET('/').body end def start_server - start_process "ruby bin/cuukie_server >/dev/null 2>&1" + start_process "ruby bin/cuukie --server >/dev/null 2>&1" wait_for_server_on_port 4569 end +def ping_on_port(port) + RestClient.get "http://localhost:#{port}/ping" +end + def wait_for_server_on_port(port) loop do begin - RestClient.get "http://localhost:#{port}/ping" + ping_on_port port return rescue; end end end