Permalink
Browse files

Failing test for reusing net/http request in Fakeweb

  • Loading branch information...
1 parent dfda4cd commit 498994aa0e2a40116b541e1575b33cb42f3c1f2a @Jacobkg Jacobkg committed with Jun 27, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 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

0 comments on commit 498994a

Please sign in to comment.