mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
warn when bundler fails and avoid having to use -I to run tests (#1270)
This commit is contained in:
parent
61de1a8891
commit
d25ef26465
23 changed files with 36 additions and 39 deletions
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/app/status"
|
require "puma/app/status"
|
||||||
require "rack"
|
require "rack"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/binder"
|
require "puma/binder"
|
||||||
require "puma/events"
|
require "puma/events"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/cli"
|
require "puma/cli"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/configuration"
|
require "puma/configuration"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/events"
|
require "puma/events"
|
||||||
|
|
||||||
|
|
|
@ -4,37 +4,34 @@
|
||||||
begin
|
begin
|
||||||
require "bundler/setup"
|
require "bundler/setup"
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
|
warn "Failed to load bundler ... this should only happen during package building"
|
||||||
end
|
end
|
||||||
|
|
||||||
require "net/http"
|
require "net/http"
|
||||||
require "timeout"
|
require "timeout"
|
||||||
require "minitest/autorun"
|
require "minitest/autorun"
|
||||||
require "minitest/pride"
|
require "minitest/pride"
|
||||||
require "puma"
|
|
||||||
require "puma/detect"
|
|
||||||
|
|
||||||
$LOAD_PATH << File.expand_path("../../lib", __FILE__)
|
$LOAD_PATH << File.expand_path("../../lib", __FILE__)
|
||||||
|
|
||||||
|
require "puma"
|
||||||
|
require "puma/detect"
|
||||||
|
|
||||||
# Either takes a string to do a get request against, or a tuple of [URI, HTTP] where
|
# 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.)
|
# HTTP is some kind of Net::HTTP request object (POST, HEAD, etc.)
|
||||||
def hit(uris)
|
def hit(uris)
|
||||||
results = []
|
uris.map do |u|
|
||||||
|
response =
|
||||||
uris.each do |u|
|
|
||||||
res = nil
|
|
||||||
|
|
||||||
if u.kind_of? String
|
if u.kind_of? String
|
||||||
res = Net::HTTP.get(URI.parse(u))
|
Net::HTTP.get(URI.parse(u))
|
||||||
else
|
else
|
||||||
url = URI.parse(u[0])
|
url = URI.parse(u[0])
|
||||||
res = Net::HTTP.new(url.host, url.port).start {|h| h.request(u[1]) }
|
Net::HTTP.new(url.host, url.port).start {|h| h.request(u[1]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
assert res != nil, "Didn't get a response: #{u}"
|
assert response, "Didn't get a response: #{u}"
|
||||||
results << res
|
response
|
||||||
end
|
end
|
||||||
|
|
||||||
return results
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module TimeoutEveryTestCase
|
module TimeoutEveryTestCase
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/puma_http11"
|
require "puma/puma_http11"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2011 Evan Phoenix
|
# Copyright (c) 2011 Evan Phoenix
|
||||||
# Copyright (c) 2005 Zed A. Shaw
|
# Copyright (c) 2005 Zed A. Shaw
|
||||||
|
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/puma_http11"
|
require "puma/puma_http11"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/cli"
|
require "puma/cli"
|
||||||
require "puma/control_cli"
|
require "puma/control_cli"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/io_buffer"
|
require "puma/io_buffer"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/minissl"
|
require "puma/minissl"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/null_io"
|
require "puma/null_io"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
class TestPersistent < Minitest::Test
|
class TestPersistent < Minitest::Test
|
||||||
def setup
|
def setup
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
class TestPumaServer < Minitest::Test
|
class TestPumaServer < Minitest::Test
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/events"
|
require "puma/events"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require 'puma/control_cli'
|
require 'puma/control_cli'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "rack/handler/puma"
|
require "rack/handler/puma"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "rack"
|
require "rack"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/events"
|
require "puma/events"
|
||||||
require "puma/tcp_logger"
|
require "puma/tcp_logger"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/events"
|
require "puma/events"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/thread_pool"
|
require "puma/thread_pool"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
# UNIX sockets are not recommended on JRuby
|
# UNIX sockets are not recommended on JRuby
|
||||||
# (or Windows)
|
# (or Windows)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright (c) 2011 Evan Phoenix
|
# Copyright (c) 2011 Evan Phoenix
|
||||||
# Copyright (c) 2005 Zed A. Shaw
|
# Copyright (c) 2005 Zed A. Shaw
|
||||||
|
|
||||||
require "test_helper"
|
require_relative "test_helper"
|
||||||
|
|
||||||
require "puma/server"
|
require "puma/server"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue