summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2016-07-12 10:39:58 +0200
committerGitHub <noreply@github.com>2016-07-12 10:39:58 +0200
commitd7599715c6d24534dcccbe29cfc058e534039053 (patch)
tree14824b08c4d0889e9767171ac5bafe3316a607f9 /test/test_helper.rb
parent27196b87e8d0ce5325381ea96ccd68ced8ee2e4d (diff)
parent6732fef4df156a02ed83f006f19f66cf567b5340 (diff)
Merge pull request #5 from azul/celluloid
Use Celluloid, Reel and Celluloid I/O based http requests
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index afdd3f9..1ed2a98 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -7,6 +7,7 @@ require 'minitest/autorun'
silence_warnings do
require 'webmock/minitest'
end
+require 'celluloid/test'
require 'nickserver'
require 'minitest/pride'
require 'minitest/hell'
@@ -48,26 +49,22 @@ class Minitest::Test
def stub_sks_get_reponse(key_id, opts = {})
options = {status: 200, body: ""}.merge(opts)
- stub_http_request(:get, Nickserver::Config.hkp_url).with(
+ stub_http_request(:get, config.hkp_url).with(
query: {op: 'get', search: "0x"+key_id, exact: 'on', options: 'mr'}
).to_return(options)
end
def stub_couch_response(uid, opts = {})
# can't stub localhost, so set couch_host to anything else
- Nickserver::Config.stub :couch_host, 'notlocalhost' do
+ config.stub :couch_host, 'notlocalhost' do
options = {status: 200, body: ""}.merge(opts)
query = "\?key=#{"%22#{uid}%22"}&reduce=false"
- stub_http_request(:get, /#{Regexp.escape(Nickserver::Config.couch_url)}.*#{query}/).to_return(options)
+ stub_http_request(:get, /#{Regexp.escape(config.couch_url)}.*#{query}/).to_return(options)
yield
end
end
- #
- # temporarily stubs the config property for the duration of the given block
- #
- def stub_config(property, value, &block)
- Nickserver::Config.stub(property, value, &block)
+ def config
+ Nickserver::Config
end
-
end