summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-08-31 12:15:20 +0200
committerAzul <azul@riseup.net>2016-09-10 08:15:47 +0200
commitf18d698d09afda894a568de79c5770704a0c9de7 (patch)
treec7f41e9fff1345a95c781efa0ea5324ea643f0f7
parent625416ac16a1216240fc4c48aa19802ef8a967a1 (diff)
refactor: remove global require in test_helper
require all the things we depend upon where we depend upon them.
-rwxr-xr-xbin/nickserver3
-rw-r--r--lib/nickserver.rb7
-rw-r--r--lib/nickserver/adapters/celluloid_http.rb1
-rw-r--r--lib/nickserver/daemon.rb3
-rw-r--r--lib/nickserver/request_handlers/leap_email_handler.rb1
-rw-r--r--lib/nickserver/server.rb5
-rw-r--r--lib/nickserver/source.rb2
-rw-r--r--test/integration/hkp_test.rb1
-rw-r--r--test/integration/nickserver_test.rb1
-rw-r--r--test/support/request_handler_test_helper.rb2
-rw-r--r--test/test_helper.rb3
11 files changed, 17 insertions, 12 deletions
diff --git a/bin/nickserver b/bin/nickserver
index 93dfd53..c56cc76 100755
--- a/bin/nickserver
+++ b/bin/nickserver
@@ -17,7 +17,8 @@ def load_local_gem(dir_path='../..')
end
load_local_gem
-require 'nickserver'
+require 'nickserver/daemon'
+require 'nickserver/server'
Nickserver::Daemon.run('nickserver') do
Nickserver::Server.start
diff --git a/lib/nickserver.rb b/lib/nickserver.rb
deleted file mode 100644
index 8843acd..0000000
--- a/lib/nickserver.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-require "nickserver/version"
-require "nickserver/config"
-require "nickserver/email_address"
-
-require "nickserver/server"
-require "nickserver/daemon"
diff --git a/lib/nickserver/adapters/celluloid_http.rb b/lib/nickserver/adapters/celluloid_http.rb
index 44b6fe8..92c5c53 100644
--- a/lib/nickserver/adapters/celluloid_http.rb
+++ b/lib/nickserver/adapters/celluloid_http.rb
@@ -1,4 +1,5 @@
require 'nickserver/adapters'
+require 'nickserver/config'
silence_warnings do
require 'celluloid/io'
end
diff --git a/lib/nickserver/daemon.rb b/lib/nickserver/daemon.rb
index 9b06a3c..9cc1af7 100644
--- a/lib/nickserver/daemon.rb
+++ b/lib/nickserver/daemon.rb
@@ -1,3 +1,6 @@
+require "nickserver/version"
+require "nickserver/config"
+
require 'etc'
require 'fileutils'
diff --git a/lib/nickserver/request_handlers/leap_email_handler.rb b/lib/nickserver/request_handlers/leap_email_handler.rb
index 548bc8a..bdebc23 100644
--- a/lib/nickserver/request_handlers/leap_email_handler.rb
+++ b/lib/nickserver/request_handlers/leap_email_handler.rb
@@ -1,3 +1,4 @@
+require 'nickserver/request_handlers/base'
require 'nickserver/email_address'
require 'nickserver/nicknym/source'
diff --git a/lib/nickserver/server.rb b/lib/nickserver/server.rb
index 8f4a49f..11e7012 100644
--- a/lib/nickserver/server.rb
+++ b/lib/nickserver/server.rb
@@ -1,7 +1,8 @@
-require 'kernel_ext'
-require 'json'
+require 'nickserver/config'
require 'nickserver/reel_server'
+require 'kernel_ext'
+require 'json'
#
# This is the main HTTP server that clients connect to in order to fetch keys
diff --git a/lib/nickserver/source.rb b/lib/nickserver/source.rb
index 78f245b..edc57e9 100644
--- a/lib/nickserver/source.rb
+++ b/lib/nickserver/source.rb
@@ -1,3 +1,5 @@
+require 'nickserver/adapters/celluloid_http'
+
module Nickserver
class Source
diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb
index 09673cf..bf78bb3 100644
--- a/test/integration/hkp_test.rb
+++ b/test/integration/hkp_test.rb
@@ -1,6 +1,5 @@
require 'test_helper'
require 'nickserver/hkp/source'
-require 'nickserver/adapters/celluloid_http'
class HkpTest < Minitest::Test
diff --git a/test/integration/nickserver_test.rb b/test/integration/nickserver_test.rb
index 9aac6b4..bdba6b7 100644
--- a/test/integration/nickserver_test.rb
+++ b/test/integration/nickserver_test.rb
@@ -1,4 +1,5 @@
require 'test_helper'
+require 'nickserver/server'
require 'json'
#
diff --git a/test/support/request_handler_test_helper.rb b/test/support/request_handler_test_helper.rb
index dd6940d..c063108 100644
--- a/test/support/request_handler_test_helper.rb
+++ b/test/support/request_handler_test_helper.rb
@@ -1,3 +1,5 @@
+require 'nickserver/request'
+
module RequestHandlerTestHelper
protected
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 1ed2a98..9f2c581 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -8,10 +8,11 @@ silence_warnings do
require 'webmock/minitest'
end
require 'celluloid/test'
-require 'nickserver'
require 'minitest/pride'
require 'minitest/hell'
+require 'nickserver/config'
+
TESTING = true
class Minitest::Test