diff options
author | Azul <azul@riseup.net> | 2016-06-09 13:51:02 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-06-09 13:51:02 +0200 |
commit | b4075771b2b1f3c688496d18d7a5a5f1db952004 (patch) | |
tree | a35d157bb5727c207ea8c21ca0990f3230bca3ca /test/unit | |
parent | 56263b6512f60cf055a925f5446f1f504bb65a4d (diff) |
refactor: remove EM specific stuff from Hkp::FetchKey interface
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/adapters/em_http_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/adapters/em_http_test.rb b/test/unit/adapters/em_http_test.rb new file mode 100644 index 0000000..659ff1b --- /dev/null +++ b/test/unit/adapters/em_http_test.rb @@ -0,0 +1,25 @@ +require 'test_helper' +require 'nickserver/adapters/em_http' + +class Nickserver::Adapters::EmHttpTest < Minitest::Test + + def test_successful_request + url = 'http://url.to' + stub_http_request(:get, url) + .with(query: {key: :value}) + .to_return status: 200, body: 'body' + EM.run do + adapter.get(url, query: {key: :value}) do |status, body| + assert_equal 200, status + assert_equal 'body', body + EM.stop + end + end + end + + protected + + def adapter + Nickserver::Adapters::EmHttp.new + end +end |