summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-06-30 11:23:45 +0200
committerAzul <azul@riseup.net>2016-06-30 12:04:07 +0200
commit0491e79c4e5f16d38cf87e53290394e1eccfa2e9 (patch)
tree56d0aff1fc8ca1bbd11b09bc6929f00132467898 /test/unit
parent4132d6e6db3755334ace352165991487802c6b82 (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/unit')
-rw-r--r--test/unit/adapters/celluloid_http_test.rb23
-rw-r--r--test/unit/adapters/em_http_test.rb25
2 files changed, 23 insertions, 25 deletions
diff --git a/test/unit/adapters/celluloid_http_test.rb b/test/unit/adapters/celluloid_http_test.rb
new file mode 100644
index 0000000..64c7a5d
--- /dev/null
+++ b/test/unit/adapters/celluloid_http_test.rb
@@ -0,0 +1,23 @@
+require 'test_helper'
+require 'nickserver/adapters/celluloid_http'
+require 'byebug'
+
+class Nickserver::Adapters::CelluloidHttpTest < 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'
+ adapter.get(url, query: {key: :value}) do |status, body|
+ assert_equal 200, status
+ assert_equal 'body', body
+ end
+ end
+
+ protected
+
+ def adapter
+ @adapter ||= Nickserver::Adapters::CelluloidHttp.new
+ end
+end
diff --git a/test/unit/adapters/em_http_test.rb b/test/unit/adapters/em_http_test.rb
deleted file mode 100644
index 659ff1b..0000000
--- a/test/unit/adapters/em_http_test.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-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