diff --git a/bin/nickserver b/bin/nickserver
index 4706d8b4bfe73fc4449589ce454cb1aca0f3ba26..0890def71c0512d2507a02ac03bbfbfd9a3e7662 100755
--- a/bin/nickserver
+++ b/bin/nickserver
@@ -5,7 +5,8 @@
 #
 
 def load_local_gem(dir_path = '../..')
-  base_directory = File.expand_path(dir_path, File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__)
+  actual_file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
+  base_directory = File.expand_path(dir_path, actual_file)
   unless $LOAD_PATH.include? "#{base_directory}/lib"
     if File.exist?("#{base_directory}/Gemfile.lock")
       ENV['BUNDLE_GEMFILE'] ||= "#{base_directory}/Gemfile"
diff --git a/test/functional/bin_test.rb b/test/functional/bin_test.rb
index 3a4e6c7c2e4372f1ce82a963666246420c6bfbcc..4d9f90440d3424d332cada8d187a69ddc2e8e8db 100644
--- a/test/functional/bin_test.rb
+++ b/test/functional/bin_test.rb
@@ -33,7 +33,7 @@ class BinTest < Minitest::Test
 
   def assert_command_runs(command)
     out = run_command command
-    assert ($CHILD_STATUS.exitstatus == 0),
+    assert $CHILD_STATUS.exitstatus.zero?,
            "failed to run 'nickserver #{command}':\n #{out}"
   end
 
diff --git a/test/functional/sample_test.rb b/test/functional/sample_test.rb
index 412555e399c0be14b49cad5a950a322fdd426618..1bfe8b5910a37fc8415e648f66e574dec9b9e9b2 100644
--- a/test/functional/sample_test.rb
+++ b/test/functional/sample_test.rb
@@ -32,7 +32,7 @@ class SampleTest < FunctionalTest
 
   # platform/#8674 handle nonexisting domains
   def test_nicknym_handles_missing_domain
-    assert_lookup_status 404, 'postmaster@now-dont-you-dare-register-this-domain.coop'
+    assert_lookup_status 404, 'postmaster@dont-you-dare-register-this.coop'
   end
 
   def test_no_file_descriptors_leak
@@ -63,7 +63,7 @@ class SampleTest < FunctionalTest
 
   def run_command(command)
     `#{command} 2>&1`.tap do |out|
-      assert ($CHILD_STATUS.exitstatus == 0),
+      assert $CHILD_STATUS.exitstatus.zero?,
              "failed to run '#{command}':\n #{out}"
     end
   end
diff --git a/test/integration/dispatcher_test.rb b/test/integration/dispatcher_test.rb
index 58aa9728927c6b264271a844be5495fa25ee00ab..1973e840a66d7d0db38d1f338ef70003e2c254fb 100644
--- a/test/integration/dispatcher_test.rb
+++ b/test/integration/dispatcher_test.rb
@@ -29,8 +29,9 @@ class Nickserver::DispatcherTest < Minitest::Test
   end
 
   def test_fingerprint_is_not_hex
-    handle fingerprint: ['X36E738D69173C13Z709E44F2F455E2824D18DDX']
-    assert_response error('Fingerprint invalid: X36E738D69173C13Z709E44F2F455E2824D18DDX')
+    fingerprint = 'X36E738D69173C13Z709E44F2F455E2824D18DDX'
+    handle fingerprint: [fingerprint]
+    assert_response error("Fingerprint invalid: #{fingerprint}")
   end
 
   def test_missing_domain
@@ -41,28 +42,32 @@ class Nickserver::DispatcherTest < Minitest::Test
   end
 
   def test_email_via_hkp
-    handle address: ['valid@email.tld'], headers: { 'Host' => 'http://nickserver.me' }
+    handle address: ['valid@email.tld'],
+           headers: { 'Host' => 'http://nickserver.me' }
     stub_nicknym_not_available
     hkp_source.expect :query, success, [Nickserver::EmailAddress]
     assert_response success
   end
 
   def test_email_via_hkp_nicknym_unreachable
-    handle address: ['valid@email.tld'], headers: { 'Host' => 'http://nickserver.me' }
+    handle address: ['valid@email.tld'],
+           headers: { 'Host' => 'http://nickserver.me' }
     stub_nicknym_raises
     hkp_source.expect :query, success, [Nickserver::EmailAddress]
     assert_response success
   end
 
   def test_email_not_found_hkp_nicknym_unreachable
-    handle address: ['valid@email.tld'], headers: { 'Host' => 'http://nickserver.me' }
+    handle address: ['valid@email.tld'],
+           headers: { 'Host' => 'http://nickserver.me' }
     stub_nicknym_raises
     hkp_source.expect :query, nil, [Nickserver::EmailAddress]
     assert_response http_connection_error
   end
 
   def test_email_via_nicknym
-    handle address: ['valid@email.tld'], headers: { 'Host' => 'http://nickserver.me' }
+    handle address: ['valid@email.tld'],
+           headers: { 'Host' => 'http://nickserver.me' }
     nicknym_source.expect :available_for?, true, [String]
     nicknym_source.expect :query, success, [Nickserver::EmailAddress]
     assert_response success
diff --git a/test/integration/nickserver_test.rb b/test/integration/nickserver_test.rb
index fb9b952108776de3bcc89d44b4ea74459df34d73..832a68c59137e3d2ee6a019557c3ec10f8cbd744 100644
--- a/test/integration/nickserver_test.rb
+++ b/test/integration/nickserver_test.rb
@@ -19,13 +19,14 @@ require 'json'
 # (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)
+# (3) the "Host" header for requests to nickserver must be set
+#     (or Config.domain set)
 #
 
 class NickserverTest < CelluloidTest
   include HttpStubHelper
 
-  def test_GET_key_by_email_address_served_via_SKS
+  def test_key_by_email_address_from_sks
     uid    = 'cloudadmin@leap.se'
     key_id = 'E818C478D3141282F7590D29D041EB11B1647490'
     stub_nicknym_available_response 'leap.se', status: 404
@@ -34,51 +35,43 @@ class NickserverTest < CelluloidTest
 
     start do
       params = { query: { 'address' => uid } }
-      get(params) do |response|
-        assert_equal file_content(:leap_public_key), JSON.parse(response.to_s)['openpgp']
-      end
+      assert_responds_to params, key: :leap_public_key
     end
   end
 
-  def test_GET_key_by_fingerprint_served_via_SKS
+  def test_key_by_fingerprint_from_sks
     fingerprint = 'E818C478D3141282F7590D29D041EB11B1647490'
     stub_sks_get_reponse(fingerprint, body: file_content(:leap_public_key))
 
     start do
       params = { query: { 'fingerprint' => fingerprint } }
-      get(params) do |response|
-        assert_equal file_content(:leap_public_key), JSON.parse(response.to_s)['openpgp']
-      end
+      assert_responds_to params, key: :leap_public_key
     end
   end
 
-  def test_GET_served_via_couch_not_found
+  def test_couch_user_not_found
     domain = 'example.org'
     uid    = 'bananas@' + domain
     stub_couch_response(uid, status: 404) do
       start do
         params = { query: { 'address' => uid }, head: { 'Host' => domain } }
-        get(params) do |response|
-          assert_equal 404, response.code
-        end
+        assert_responds_to params, code: 404
       end
     end
   end
 
-  def test_GET_served_via_couch_empty_results
+  def test_couch_empty_results
     domain = 'example.org'
     uid    = 'stompy@' + domain
     stub_couch_response(uid, body: file_content(:empty_couchdb_result)) do
       start do
         params = { query: { 'address' => uid }, head: { host: domain } }
-        get(params) do |response|
-          assert_equal 404, response.code
-        end
+        assert_responds_to params, code: 404
       end
     end
   end
 
-  def test_GET_served_via_couch_success
+  def test_couch_success_response
     domain = 'example.org'
     uid    = 'blue@' + domain
     stub_couch_response(uid, body: file_content(:blue_couchdb_result)) do
@@ -91,7 +84,7 @@ class NickserverTest < CelluloidTest
     end
   end
 
-  def test_GET_empty
+  def test_empty_get
     start do
       get({}) do |response|
         assert_equal "404 Not Found\n", response.to_s
@@ -113,6 +106,16 @@ class NickserverTest < CelluloidTest
     server.terminate if server && server.alive?
   end
 
+  def assert_responds_to(params, key: nil, code: nil)
+    get(params) do |response|
+      assert_equal code, response.code if code
+      if key
+        assert_equal file_content(key),
+                     JSON.parse(response.to_s)['openpgp']
+      end
+    end
+  end
+
   #
   # http GET requests to nickserver
   #
@@ -130,7 +133,8 @@ class NickserverTest < CelluloidTest
   #
   # http request to nickserver
   #
-  # this works because http requests to 127.0.0.1 are not stubbed, but requests to other domains are.
+  # this works because http requests to 127.0.0.1 are not stubbed, but
+  # requests to other domains are.
   #
   def request(method, options = {})
     response = HTTP
diff --git a/test/remote/hkp_source_test.rb b/test/remote/hkp_source_test.rb
index 8232dce5770c218ae6a6d6e35e74dab3b0aabf95..469941bba347c00b46bed39f6fec2e65af3f6de8 100644
--- a/test/remote/hkp_source_test.rb
+++ b/test/remote/hkp_source_test.rb
@@ -7,32 +7,27 @@ class RemoteHkpSourceTest < CelluloidTest
   include HttpAdapterHelper
 
   def test_key_info
-    uid = 'elijah@riseup.net'
-    assert_key_info_for_uid uid do |keys|
-      assert_equal 1, keys.size
-      assert keys.first.keyid =~ /00440025$/
-    end
+    assert_key_found 'elijah@riseup.net', /00440025$/
   end
 
   def test_tls_validation
-    hkp_url = 'https://keys.mayfirst.org/pks/lookup'
-    ca_file = file_path('mayfirst-ca.pem')
-
     config.stub(:hkp_url, hkp_url) do
-      # config.stub(:hkp_ca_file, file_path('autistici-ca.pem')) do
       config.stub(:hkp_ca_file, ca_file) do
         assert File.exist?(Nickserver::Config.hkp_ca_file)
-        uid = 'elijah@riseup.net'
-        assert_key_info_for_uid uid do |keys|
-          assert_equal 1, keys.size
-          assert keys.first.keyid =~ /00440025$/
-        end
+        assert_key_found 'elijah@riseup.net', /00440025$/
       end
     end
   end
 
   protected
 
+  def assert_key_found(uid, fingerprint_regexp)
+    assert_key_info_for_uid uid do |keys|
+      assert_equal 1, keys.size
+      assert keys.first.keyid =~ fingerprint_regexp
+    end
+  end
+
   def assert_key_info_for_uid(uid)
     status, keys = source.search uid
     assert_equal 200, status
@@ -44,4 +39,12 @@ class RemoteHkpSourceTest < CelluloidTest
   def source
     Nickserver::Hkp::Source.new adapter
   end
+
+  def hkp_url
+    'https://keys.mayfirst.org/pks/lookup'
+  end
+
+  def ca_file
+    file_path('mayfirst-ca.pem')
+  end
 end
diff --git a/test/remote/nicknym_source_test.rb b/test/remote/nicknym_source_test.rb
index 6fff1f67ee1b6b4f656041dbac2feacc92b4ffbf..ef746531a103966418c7562feb2770e396b04da3 100644
--- a/test/remote/nicknym_source_test.rb
+++ b/test/remote/nicknym_source_test.rb
@@ -63,6 +63,6 @@ class RemoteNicknymSourceTest < CelluloidTest
   end
 
   def email_without_key
-    Nickserver::EmailAddress.new('pleaseneverusethisemailweuseittotest@mail.bitmask.net')
+    Nickserver::EmailAddress.new('neverusethisweuseittotest@mail.bitmask.net')
   end
 end
diff --git a/test/remote/wkd_source_test.rb b/test/remote/wkd_source_test.rb
index 1ed7ea52c9d13e92ebb4043aa27036bf76d90905..46a6bbbbe741dc3889e501389f17139ebecc30c6 100644
--- a/test/remote/wkd_source_test.rb
+++ b/test/remote/wkd_source_test.rb
@@ -27,8 +27,8 @@ class RemoteWkdSourceTest < CelluloidTest
 
   def assert_pgp_key_in(response)
     json = JSON.parse response.content
-    assert_equal email_with_key.to_s, json["address"]
-    refute_empty json["openpgp"]
+    assert_equal email_with_key.to_s, json['address']
+    refute_empty json['openpgp']
     assert_equal file_content('dewey.pgp.asc'), json['openpgp']
   end