1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Minor test helper cleanup

This commit is contained in:
Nate Berkopec 2020-03-07 07:34:35 -06:00
parent b2b5789888
commit b5d7786b16
No known key found for this signature in database
GPG key ID: BDD7A4B8E43906A6
3 changed files with 4 additions and 4 deletions

View file

@ -11,26 +11,23 @@ if %w(2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1).include? RUBY_VERSION
end
end
require "net/http"
require "timeout"
require "minitest/autorun"
require "minitest/pride"
require "minitest/proveit"
require_relative "helpers/apps"
$LOAD_PATH << File.expand_path("../../lib", __FILE__)
Thread.abort_on_exception = true
$debugging_info = ''.dup
$debugging_hold = false # needed for TestCLI#test_control_clustered
require "puma"
require "puma/events"
require "puma/detect"
# Either takes a string to do a get request against, or a tuple of [URI, HTTP] where
# HTTP is some kind of Net::HTTP request object (POST, HEAD, etc.)
def hit(uris)
require "net/http"
uris.map do |u|
response =
if u.kind_of? String
@ -58,6 +55,7 @@ module UniquePort
end
end
require "timeout"
module TimeoutEveryTestCase
# our own subclass so we never confused different timeouts
class TestTookTooLong < Timeout::Error

View file

@ -5,6 +5,7 @@ require_relative "helpers/ssl"
require "puma/binder"
require "puma/puma_http11"
require "puma/events"
class TestBinderBase < Minitest::Test
include SSLHelper

View file

@ -63,6 +63,7 @@ class TestCLI < Minitest::Test
end
def test_control_for_ssl
require "net/http"
control_port = UniquePort.call
control_host = "127.0.0.1"
control_url = "ssl://#{control_host}:#{control_port}?#{ssl_query}"