Skip to content

Commit

Permalink
fix test startup
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Nov 3, 2008
1 parent bafaaf3 commit cf407ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gem_eval_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
require 'cgi'

OUTPUT = !!ENV['SERVER_OUTPUT']
if ! OUTPUT
puts "gem_eval server output disabled, set SERVER_OUTPUT=1 to enable"
end
puts "gem_eval server output disabled, set SERVER_OUTPUT=1 to enable" if ! OUTPUT

class GemEvalTest < Test::Unit::TestCase
def setup
system("mv git_mock git")
@pid = fork { exec("PATH=.:$PATH ruby gem_eval.rb #{' > /dev/null 2>&1' unless OUTPUT}") }

# wait for server to start
Timeout::timeout(3) do
Timeout::timeout(5) do
begin
TCPSocket.open('localhost', 4567){}
TCPSocket.open('localhost', 4567) {}
server_started = true
rescue Errno::ECONNREFUSED
server_started = false
sleep 0.1
retry
end until server_started
end
end
Expand Down

0 comments on commit cf407ff

Please sign in to comment.