From fb2d7e6f8f1fceefbc8964d34369a867eb8f25bb Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 2 Jul 2016 12:03:46 +0200 Subject: refactor: replace blocks/yields with returns This became possible because we now use celluloid. Celluloid handles asynchronity without the need for callbacks or blocks. --- test/unit/adapters/celluloid_http_test.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'test/unit/adapters/celluloid_http_test.rb') diff --git a/test/unit/adapters/celluloid_http_test.rb b/test/unit/adapters/celluloid_http_test.rb index 87e7f55..4381b8f 100644 --- a/test/unit/adapters/celluloid_http_test.rb +++ b/test/unit/adapters/celluloid_http_test.rb @@ -18,18 +18,16 @@ class Nickserver::Adapters::CelluloidHttpTest < Minitest::Test stub_http_request(:get, url) .with(query: {key: :value}) .to_return status: 200, body: 'body' - adapter.get(url, query: {key: :value}) do |status, body| - assert_equal 200, status - assert_equal 'body', body - end + status, body = adapter.get(url, query: {key: :value}) + assert_equal 200, status + assert_equal 'body', body end def test_https_for_hkp url = Nickserver::Config.hkp_url real_network do - adapter.get url do |status, _body| - assert_equal 404, status - end + status, _body = adapter.get url + assert_equal 404, status end end -- cgit v1.2.3