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

pull requests for better logic welcome
This commit is contained in:
Konstantin Haase 2012-03-07 22:26:54 +01:00
parent a0adda9c7a
commit fa1d32382b
1 changed files with 5 additions and 1 deletions

View File

@ -67,8 +67,11 @@ module IntegrationHelper
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 @@ module IntegrationHelper
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