Skip to content

Commit

Permalink
Require puma/events in test helper (#1418)
Browse files Browse the repository at this point in the history
Moves the require for puma/events from the individual test files and
into the main test helper.

The reason for this was while I was debugging the `test_puma_server.rb`
tests I was getting an error for an uninitialized constant for
`Puma::Event`.

Moving the require from the individual files to the test help means the
`puma/events` will always be included instead of having to remember to
do that. It makes debugging individual tests locally easier.
  • Loading branch information
eileencodes authored and nateberkopec committed Sep 22, 2017
1 parent 459ab19 commit 6714214
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions test/helper.rb
Expand Up @@ -21,6 +21,7 @@
Thread.abort_on_exception = true

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
Expand Down
1 change: 0 additions & 1 deletion test/test_binder.rb
@@ -1,7 +1,6 @@
require_relative "helper"

require "puma/binder"
require "puma/events"
require "puma/puma_http11"

class TestBinder < Minitest::Test
Expand Down
2 changes: 0 additions & 2 deletions test/test_events.rb
@@ -1,7 +1,5 @@
require_relative "helper"

require "puma/events"

class TestEvents < Minitest::Test
def test_null
events = Puma::Events.null
Expand Down
2 changes: 0 additions & 2 deletions test/test_puma_server_ssl.rb
@@ -1,7 +1,5 @@
require_relative "helper"

require "puma/events"

class SSLEventsHelper < ::Puma::Events
attr_accessor :addr, :cert, :error

Expand Down
1 change: 0 additions & 1 deletion test/test_tcp_logger.rb
@@ -1,6 +1,5 @@
require_relative "helper"

require "puma/events"
require "puma/tcp_logger"

class TestTCPLogger < Minitest::Test
Expand Down
2 changes: 0 additions & 2 deletions test/test_tcp_rack.rb
@@ -1,7 +1,5 @@
require_relative "helper"

require "puma/events"

class TestTCPRack < Minitest::Test

def setup
Expand Down

0 comments on commit 6714214

Please sign in to comment.