Permalink
Browse files

Play nice with excon >= 0.29.0

  • Loading branch information...
1 parent 925f243 commit 4e5029635beccbf0678d9b78c037e7ed936d0e14 @ixti ixti committed Jan 12, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 spec/acceptance/excon/excon_spec_helper.rb
@@ -7,8 +7,13 @@ def http_request(method, uri, options = {}, &block)
uri = Addressable::URI.heuristic_parse(uri)
uri = uri.omit(:userinfo).to_s.gsub(' ', '%20')
- options = options.merge(:method => method, :nonblock => false) # Dup and merge
- response = Excon.new(uri).request(options, &block)
+ if Gem::Version.new(Excon::VERSION) < Gem::Version.new("0.29.0")
+ options = options.merge(:method => method, :nonblock => false) # Dup and merge
+ response = Excon.new(uri).request(options, &block)
+ else
+ options = options.merge(:method => method) # Dup and merge
+ response = Excon.new(uri, :nonblock => false).request(options, &block)
+ end
headers = WebMock::Util::Headers.normalize_headers(response.headers)
headers = headers.inject({}) do |res, (name, value)|

0 comments on commit 4e50296

Please sign in to comment.