From 0491e79c4e5f16d38cf87e53290394e1eccfa2e9 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 30 Jun 2016 11:23:45 +0200 Subject: Trying to replace EM base server with reel some tests are still broken. But at least they are running now. --- test/integration/hkp_test.rb | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'test/integration/hkp_test.rb') diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb index a824a3f..cbb8190 100644 --- a/test/integration/hkp_test.rb +++ b/test/integration/hkp_test.rb @@ -1,6 +1,6 @@ require 'test_helper' require 'nickserver/hkp/source' -require 'nickserver/adapters/em_http' +require 'nickserver/adapters/celluloid_http' class HkpTest < Minitest::Test @@ -89,9 +89,9 @@ class HkpTest < Minitest::Test ca_file = file_path('mayfirst-ca.pem') real_network do - stub_config(:hkp_url, hkp_url) do - stub_config(:hkp_ca_file, ca_file) do - #stub_config(:hkp_ca_file, file_path('autistici-ca.pem')) do + config.stub(:hkp_url, hkp_url) do + config.stub(:hkp_ca_file, ca_file) do + #config.stub(:hkp_ca_file, file_path('autistici-ca.pem')) do assert File.exist?(Nickserver::Config.hkp_ca_file) uid = 'elijah@riseup.net' assert_key_info_for_uid uid do |keys| @@ -112,26 +112,20 @@ class HkpTest < Minitest::Test end def assert_response_for_uid(uid, &block) - EM.run do - Nickserver::Hkp::Source.new(adapter).query uid do |response| - yield response - EM.stop - end + Nickserver::Hkp::Source.new(adapter).query uid do |response| + yield response end end def assert_key_info_for_uid(uid, &block) - EM.run do - Nickserver::Hkp::Source.new(adapter).search uid do |status, keys| - assert_equal 200, status - yield keys - EM.stop - end + Nickserver::Hkp::Source.new(adapter).search uid do |status, keys| + assert_equal 200, status + yield keys end end def adapter - Nickserver::Adapters::EmHttp.new + Nickserver::Adapters::CelluloidHttp.new end def fetch_key_info(body_source, uid, &block) -- cgit v1.2.3 From fe9a23419f9a875a98fc05dc22e2ad6c5f6dbe3b Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 30 Jun 2016 13:47:40 +0200 Subject: actually use celluloid io for http requests --- test/integration/hkp_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/integration/hkp_test.rb') diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb index cbb8190..586b3ab 100644 --- a/test/integration/hkp_test.rb +++ b/test/integration/hkp_test.rb @@ -1,9 +1,21 @@ require 'test_helper' require 'nickserver/hkp/source' require 'nickserver/adapters/celluloid_http' +require 'celluloid/test' class HkpTest < Minitest::Test + 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' -- cgit v1.2.3 From 8a664a39bc3dd77a9c53fa5931f81c2b2b8b7295 Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 2 Jul 2016 10:49:48 +0200 Subject: minor: silence warnings and cleanup --- test/integration/hkp_test.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'test/integration/hkp_test.rb') diff --git a/test/integration/hkp_test.rb b/test/integration/hkp_test.rb index 586b3ab..09673cf 100644 --- a/test/integration/hkp_test.rb +++ b/test/integration/hkp_test.rb @@ -1,7 +1,6 @@ require 'test_helper' require 'nickserver/hkp/source' require 'nickserver/adapters/celluloid_http' -require 'celluloid/test' class HkpTest < Minitest::Test -- cgit v1.2.3