Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Failing test for reusing net/http request in Fakeweb

  • Loading branch information...
commit 498994aa0e2a40116b541e1575b33cb42f3c1f2a 1 parent dfda4cd
@Jacobkg Jacobkg authored committed
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/vcr/library_hooks/fakeweb_spec.rb
View
15 spec/vcr/library_hooks/fakeweb_spec.rb
@@ -95,6 +95,21 @@ def make_post_request
ignored_body.should_not eq(recorded_body)
ignored_body.should match(/Response \d+/)
end
+
+ it "Make request twice against cassette using the same http request object" do
+ uri = URI.parse("http://localhost:#{VCR::SinatraApp.port}/foo")
+ http = Net::HTTP.new(uri.host, uri.port)
+ VCR.use_cassette("new_cassette", :record => :once) do
+ request = Net::HTTP::Get.new(uri.request_uri)
+ http.request(request)
+ end
+
+ VCR.use_cassette("new_cassette", :record => :once) do
+ request = Net::HTTP::Get.new(uri.request_uri)
+ http.request(request)
+ http.request(request)
+ end
+ end
end
describe "VCR.configuration.after_library_hooks_loaded hook" do
Please sign in to comment.
Something went wrong with that request. Please try again.