diff options
author | Azul <azul@riseup.net> | 2016-06-30 11:23:45 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-06-30 12:04:07 +0200 |
commit | 0491e79c4e5f16d38cf87e53290394e1eccfa2e9 (patch) | |
tree | 56d0aff1fc8ca1bbd11b09bc6929f00132467898 /test/test_helper.rb | |
parent | 4132d6e6db3755334ace352165991487802c6b82 (diff) |
Trying to replace EM base server with reel
some tests are still broken. But at least they are running now.
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r-- | test/test_helper.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index afdd3f9..689928c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -48,26 +48,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 |