Skip to content

Commit

Permalink
Merge pull request #253 from i0rek/url
Browse files Browse the repository at this point in the history
Various fixes for Typhoeus
  • Loading branch information
bblimke committed Feb 17, 2013
2 parents 179f80e + feafeb8 commit fb76bcd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb
Expand Up @@ -60,7 +60,7 @@ def self.build_request_signature(req)
body = req.options[:body] body = req.options[:body]


request_signature = WebMock::RequestSignature.new( request_signature = WebMock::RequestSignature.new(
req.options[:method], req.options[:method] || :get,
uri.to_s, uri.to_s,
:body => body, :body => body,
:headers => req.options[:headers] :headers => req.options[:headers]
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/em_http_request/em_http_request_spec.rb
Expand Up @@ -13,7 +13,7 @@


#functionality only supported for em-http-request 1.x #functionality only supported for em-http-request 1.x
if defined?(EventMachine::HttpConnection) if defined?(EventMachine::HttpConnection)
context 'when a real request is made and redirects are followed' do context 'when a real request is made and redirects are followed', :net_connect => true do
before { WebMock.allow_net_connect! } before { WebMock.allow_net_connect! }


# This url redirects to the https URL. # This url redirects to the https URL.
Expand Down Expand Up @@ -116,7 +116,7 @@ def response(resp)
end end
end end


context 'making a real request' do context 'making a real request', :net_connect => true do
before { WebMock.allow_net_connect! } before { WebMock.allow_net_connect! }
include_examples "em-http-request middleware/after_request hook integration" include_examples "em-http-request middleware/after_request hook integration"
end end
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/shared/complex_cross_concern_behaviors.rb
Expand Up @@ -20,7 +20,7 @@


let(:no_content_url) { 'http://httpstat.us/204' } let(:no_content_url) { 'http://httpstat.us/204' }
[nil, ''].each do |stub_val| [nil, ''].each do |stub_val|
it "returns the same value (nil or "") for a request stubbed as #{stub_val.inspect} that a real empty response has" do it "returns the same value (nil or "") for a request stubbed as #{stub_val.inspect} that a real empty response has", :net_connect => true do
unless http_library == :curb unless http_library == :curb
WebMock.allow_net_connect! WebMock.allow_net_connect!


Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/typhoeus/typhoeus_hydra_spec.rb
Expand Up @@ -22,7 +22,7 @@


describe "when params are used" do describe "when params are used" do
it "should take into account params for POST request" do it "should take into account params for POST request" do
stub_request(:post, "www.example.com").with(:params => {:hello => 'world'}) stub_request(:post, "www.example.com/?hello=world").with(:params => {:hello => 'world'})
request = Typhoeus::Request.new("http://www.example.com", :method => :post, :params => {:hello => 'world'}) request = Typhoeus::Request.new("http://www.example.com", :method => :post, :params => {:hello => 'world'})
hydra.queue(request) hydra.queue(request)
hydra.run hydra.run
Expand Down

0 comments on commit fb76bcd

Please sign in to comment.