Permalink
Browse files

use PID for port (so two tests can run in parallel)

pull requests for better logic welcome
  • Loading branch information...
1 parent a0adda9 commit fa1d32382bf74838efc360eed9be1362809c7f30 @rkh rkh committed Mar 7, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/integration_helper.rb
@@ -67,8 +67,11 @@ def alive?
false
end
+ def open(url)
+ super("http://127.0.0.1:#{port}#{url}")
+ end
+
def get(url)
- url = "http://127.0.0.1:#{port}#{url}"
open(url).read
end
@@ -126,6 +129,7 @@ def it(message, &block)
def self.extend_object(obj)
super
+ base_port = 5000 + Process.pid % 100
Sinatra::Base.server.each_with_index do |server, index|
Server.run(server, 5000+index)
end

0 comments on commit fa1d323

Please sign in to comment.