From 5967c4a568aff2c5e73e3ab933aa68d25387aeb1 Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 2 Oct 2016 15:05:02 +0200 Subject: silence Celluloid.logger in tests Introduced CelluloidTest as a test class for all tests that depend on Celluloid being up and running. --- test/integration/hkp_test.rb | 11 ----------- test/integration/nicknym_test.rb | 11 ----------- test/integration/nickserver_test.rb | 16 ++++------------ test/remote/celluloid_http_test.rb | 13 ++----------- test/remote/hkp_source_test.rb | 13 ++----------- test/remote/nicknym_source_test.rb | 13 ++----------- test/support/celluloid_test.rb | 14 ++++++++++++++ test/support/client_integration_test.rb | 13 ------------- 8 files changed, 24 insertions(+), 80 deletions(-) delete mode 100644 test/integration/nicknym_test.rb create mode 100644 test/support/celluloid_test.rb delete mode 100644 test/support/client_integration_test.rb diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb index 7d4bb6b..da128c2 100644 --- a/test/integration/hkp_test.rb +++ b/test/integration/hkp_test.rb @@ -5,17 +5,6 @@ require 'nickserver/hkp/source' class HkpTest < Minitest::Test include HttpStubHelper - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end - - def test_key_info_expired fetch_key_info(:hkp_vindex_result, 'lemur@leap.se') do |keys| assert_equal 1, keys.length, 'should find a single key' diff --git a/test/integration/nicknym_test.rb b/test/integration/nicknym_test.rb deleted file mode 100644 index bfcd7e1..0000000 --- a/test/integration/nicknym_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'test_helper' -require 'support/client_integration_test' -require 'nickserver/nicknym/source' - -class NicknymClientTest < ClientIntegrationTest - - def test_truth - assert true - end - -end diff --git a/test/integration/nickserver_test.rb b/test/integration/nickserver_test.rb index 06d6e29..5dffcd2 100644 --- a/test/integration/nickserver_test.rb +++ b/test/integration/nickserver_test.rb @@ -1,4 +1,5 @@ require 'test_helper' +require 'support/celluloid_test' require 'support/http_stub_helper' require 'nickserver/server' require 'json' @@ -15,24 +16,15 @@ require 'json' # # (1) We mock the http adapter. So no network is required. # -# (2) We actually start the nickserver on 127.0.0.1 and talk to it via http. +# (2) We actually start the Reelserver on 127.0.0.1 and talk to it via http. +# In order to run the Reelserver properly this is a celluloid test. # # (3) the "Host" header for requests to nickserver must be set (or Config.domain set) # -class NickserverTest < Minitest::Test +class NickserverTest < CelluloidTest include HttpStubHelper - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end - def test_GET_key_by_email_address_served_via_SKS uid = 'cloudadmin@leap.se' key_id = 'E818C478D3141282F7590D29D041EB11B1647490' diff --git a/test/remote/celluloid_http_test.rb b/test/remote/celluloid_http_test.rb index d5d33b4..da5f5d7 100644 --- a/test/remote/celluloid_http_test.rb +++ b/test/remote/celluloid_http_test.rb @@ -1,17 +1,8 @@ require 'test_helper' +require 'support/celluloid_test' require 'nickserver/adapters/celluloid_http' -class Nickserver::Adapters::CelluloidHttpTest < Minitest::Test - - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end +class Nickserver::Adapters::CelluloidHttpTest < CelluloidTest def test_https_for_hkp url = Nickserver::Config.hkp_url diff --git a/test/remote/hkp_source_test.rb b/test/remote/hkp_source_test.rb index a4761fb..103b8ad 100644 --- a/test/remote/hkp_source_test.rb +++ b/test/remote/hkp_source_test.rb @@ -1,17 +1,8 @@ require 'test_helper' +require 'support/celluloid_test' require 'nickserver/hkp/source' -class RemoteHkpSourceTest < Minitest::Test - - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end +class RemoteHkpSourceTest < CelluloidTest def test_key_info uid = 'elijah@riseup.net' diff --git a/test/remote/nicknym_source_test.rb b/test/remote/nicknym_source_test.rb index b38a991..e2896ca 100644 --- a/test/remote/nicknym_source_test.rb +++ b/test/remote/nicknym_source_test.rb @@ -1,21 +1,12 @@ require 'test_helper' +require 'support/celluloid_test' require 'nickserver/nicknym/source' require 'nickserver/email_address' # # Please note the Readme.md file in this directory # -class RemoteNicknymSourceTest < Minitest::Test - - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end +class RemoteNicknymSourceTest < CelluloidTest def test_availablility_check source.available_for? 'mail.bitmask.net' diff --git a/test/support/celluloid_test.rb b/test/support/celluloid_test.rb new file mode 100644 index 0000000..ddcfcbb --- /dev/null +++ b/test/support/celluloid_test.rb @@ -0,0 +1,14 @@ +class CelluloidTest < Minitest::Test + + def setup + super + Celluloid.boot + Celluloid.logger = nil + end + + def teardown + Celluloid.shutdown + super + end + +end diff --git a/test/support/client_integration_test.rb b/test/support/client_integration_test.rb deleted file mode 100644 index b05db73..0000000 --- a/test/support/client_integration_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -class ClientIntegrationTest - - def setup - super - Celluloid.boot - end - - def teardown - Celluloid.shutdown - super - end - -end -- cgit v1.2.3