mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
use PID for port (so two tests can run in parallel)
pull requests for better logic welcome
This commit is contained in:
parent
a0adda9c7a
commit
fa1d32382b
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue