summaryrefslogtreecommitdiff
path: root/test/remote
diff options
context:
space:
mode:
Diffstat (limited to 'test/remote')
-rw-r--r--test/remote/hkp_source_test.rb11
-rw-r--r--test/remote/nicknym_source_test.rb4
2 files changed, 12 insertions, 3 deletions
diff --git a/test/remote/hkp_source_test.rb b/test/remote/hkp_source_test.rb
index 103b8ad..ff61513 100644
--- a/test/remote/hkp_source_test.rb
+++ b/test/remote/hkp_source_test.rb
@@ -1,8 +1,10 @@
require 'test_helper'
require 'support/celluloid_test'
+require 'support/http_adapter_helper'
require 'nickserver/hkp/source'
class RemoteHkpSourceTest < CelluloidTest
+ include HttpAdapterHelper
def test_key_info
uid = 'elijah@riseup.net'
@@ -31,12 +33,17 @@ class RemoteHkpSourceTest < CelluloidTest
protected
- def assert_key_info_for_uid(uid, &block)
- Nickserver::Hkp::Source.new.search uid do |status, keys|
+ def assert_key_info_for_uid(uid)
+ source.search uid do |status, keys|
assert_equal 200, status
yield keys
end
rescue HTTP::ConnectionError => e
skip "could not talk to hkp server: #{e}"
end
+
+ def source
+ Nickserver::Hkp::Source.new adapter
+ end
+
end
diff --git a/test/remote/nicknym_source_test.rb b/test/remote/nicknym_source_test.rb
index 7840e10..4ca3033 100644
--- a/test/remote/nicknym_source_test.rb
+++ b/test/remote/nicknym_source_test.rb
@@ -1,5 +1,6 @@
require 'test_helper'
require 'support/celluloid_test'
+require 'support/http_adapter_helper'
require 'nickserver/nicknym/source'
require 'nickserver/email_address'
@@ -7,6 +8,7 @@ require 'nickserver/email_address'
# Please note the Readme.md file in this directory
#
class RemoteNicknymSourceTest < CelluloidTest
+ include HttpAdapterHelper
def test_availablility_check
source.available_for? 'mail.bitmask.net'
@@ -42,7 +44,7 @@ class RemoteNicknymSourceTest < CelluloidTest
end
def source
- @source ||= Nickserver::Nicknym::Source.new
+ @source ||= Nickserver::Nicknym::Source.new adapter
end
def email_with_key