1
0
Fork 0
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:
Michael Grosser 2017-04-11 14:48:11 -07:00 committed by Nate Berkopec
parent 61de1a8891
commit d25ef26465
23 changed files with 36 additions and 39 deletions

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/app/status" require "puma/app/status"
require "rack" require "rack"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/binder" require "puma/binder"
require "puma/events" require "puma/events"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/cli" require "puma/cli"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/configuration" require "puma/configuration"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/events" require "puma/events"

View file

@ -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

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/puma_http11" require "puma/puma_http11"

View file

@ -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"

View file

@ -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"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/io_buffer" require "puma/io_buffer"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/minissl" require "puma/minissl"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/null_io" require "puma/null_io"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
class TestPersistent < Minitest::Test class TestPersistent < Minitest::Test
def setup def setup

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
class TestPumaServer < Minitest::Test class TestPumaServer < Minitest::Test

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/events" require "puma/events"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require 'puma/control_cli' require 'puma/control_cli'

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "rack/handler/puma" require "rack/handler/puma"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "rack" require "rack"

View file

@ -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"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/events" require "puma/events"

View file

@ -1,4 +1,4 @@
require "test_helper" require_relative "test_helper"
require "puma/thread_pool" require "puma/thread_pool"

View file

@ -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)

View file

@ -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"