Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: myronmarston/vcr
...
head fork: myronmarston/vcr
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
2  lib/vcr/library_hooks/fakeweb.rb
@@ -49,7 +49,7 @@ def request_type(*args)
end
def set_typed_request_for_after_hook(request_type)
- @request.instance_variable_set(:@__vcr_request_type, request_type)
+ @request.instance_variable_set(:@__vcr_request_type, request_type) unless request_type == :stubbed_by_vcr
super
end
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

No commit comments for this range

Something went wrong with that request. Please try again.