From 8a70059fed66daa00dd9f8558748255735c91846 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 24 Dec 2012 16:25:39 -0800 Subject: added nickserver daemon --- test/unit/server_test.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/unit/server_test.rb b/test/unit/server_test.rb index e4c2dc6..5a6bd8d 100644 --- a/test/unit/server_test.rb +++ b/test/unit/server_test.rb @@ -2,6 +2,9 @@ require File.expand_path('test_helper', File.dirname(__FILE__)) class ServerTest < MiniTest::Unit::TestCase + # + # this test works because http requests to localhost are not stubbed, but requests to other domains are. + # def test_server uid = 'cloudadmin@leap.se' key_id = 'E818C478D3141282F7590D29D041EB11B1647490' @@ -9,19 +12,19 @@ class ServerTest < MiniTest::Unit::TestCase stub_get_response(key_id, :body => file_content(:leap_public_key)) EM.run do - EM.start_server '0.0.0.0', Nickserver::Config.port, Nickserver::Server - + Nickserver::Server.start params = {:query => {}, :path => "key/#{CGI.escape(uid)}"} http = EventMachine::HttpRequest.new("http://localhost:#{Nickserver::Config.port}").get(params) http.callback { assert_equal file_content(:leap_public_key), http.response EM.stop + return }.errback { - puts http.error + flunk http.error EM.stop } end + flunk 'should not get here' end end - -- cgit v1.2.3