Permalink
Browse files

Only include the EY::Synchrony handler if EY::Synchrony is defined.

  • Loading branch information...
1 parent 10bd7d0 commit 642b34832ef1616ad5aeab107ba70ce7480c7e53 @benburkert benburkert committed Apr 18, 2011
Showing with 11 additions and 6 deletions.
  1. +11 −6 spec/helpers/handler_helper.rb
@@ -10,12 +10,17 @@ def async_handler_map
end
def sync_handler_map
- {
- Rack::Client::Handler::NetHTTP => NetHTTPHelper::Sync,
- Rack::Client::Handler::Typhoeus => TyphoeusHelper::Sync,
- Rack::Client::Handler::Excon => ExconHelper::Sync,
- Rack::Client::Handler::EmHttp => EmHttpHelper::Sync,
- }
+ handler = {
+ Rack::Client::Handler::NetHTTP => NetHTTPHelper::Sync,
+ Rack::Client::Handler::Typhoeus => TyphoeusHelper::Sync,
+ Rack::Client::Handler::Excon => ExconHelper::Sync,
+ }
+
+ if defined?(EY::Synchrony)
+ handler[Rack::Client::Handler::EmHttp] = EmHttpHelper::Sync
+ end
+
+ handler
end
def async_handler_context(handler, *middlewares, &block)

0 comments on commit 642b348

Please sign in to comment.