Module VCR
In: lib/vcr.rb
lib/vcr/test_frameworks/cucumber.rb
lib/vcr/test_frameworks/rspec.rb
lib/vcr/util/hooks.rb
lib/vcr/util/internet_connection.rb
lib/vcr/util/variable_args_block_caller.rb
lib/vcr/util/yaml.rb
lib/vcr/util/ping.rb
lib/vcr/util/basic_object.rb
lib/vcr/util/regexes.rb
lib/vcr/request_matcher.rb
lib/vcr/cassette.rb
lib/vcr/http_stubbing_adapters/multi_object_proxy.rb
lib/vcr/http_stubbing_adapters/faraday.rb
lib/vcr/http_stubbing_adapters/common.rb
lib/vcr/http_stubbing_adapters/excon.rb
lib/vcr/http_stubbing_adapters/typhoeus.rb
lib/vcr/http_stubbing_adapters/webmock.rb
lib/vcr/http_stubbing_adapters/fakeweb.rb
lib/vcr/middleware/faraday.rb
lib/vcr/middleware/rack.rb
lib/vcr/middleware/common.rb
lib/vcr/middleware/cassette_arguments.rb
lib/vcr/version.rb
lib/vcr/extensions/net_http_response.rb
lib/vcr/config.rb
lib/vcr/cassette/reader.rb
lib/vcr/deprecations/cassette.rb
lib/vcr/deprecations/http_stubbing_adapters/common.rb
lib/vcr/deprecations/http_stubbing_adapters/fakeweb.rb
lib/vcr/deprecations/config.rb
lib/vcr/structs/normalizers/header.rb
lib/vcr/structs/normalizers/body.rb
lib/vcr/structs/normalizers/uri.rb
lib/vcr/structs/normalizers/status_message.rb
lib/vcr/structs/response.rb
lib/vcr/structs/request.rb
lib/vcr/structs/response_status.rb
lib/vcr/structs/http_interaction.rb

A Net::HTTP response that has already been read raises an IOError when read_body is called with a destination string or block.

This causes a problem when VCR records a response—it reads the body before yielding the response, and if the code that is consuming the HTTP requests uses read_body, it can cause an error.

This is a bit of a hack, but it allows a Net::HTTP response to be "re-read" after it has aleady been read. This attemps to preserve the behavior of read_body, acting just as if it had never been read.

Methods

Included Modules

VariableArgsBlockCaller

Classes and Modules

Module VCR::Config
Module VCR::Hooks
Module VCR::HttpStubbingAdapters
Module VCR::InternetConnection
Module VCR::Middleware
Module VCR::Net
Module VCR::Normalizers
Module VCR::Ping
Module VCR::RSpec
Module VCR::Regexes
Module VCR::VariableArgsBlockCaller
Class VCR::BasicObject
Class VCR::Cassette
Class VCR::CassetteInUseError
Class VCR::CucumberTags
Class VCR::HTTPInteraction
Class VCR::Request
Class VCR::RequestMatcher
Class VCR::Response
Class VCR::ResponseStatus
Class VCR::TurnedOffError

Constants

LOCALHOST_ALIASES = %w( localhost 127.0.0.1 0.0.0.0 )
YAML = begin require 'psych'   Attempt to use psych if it is available.
Ping = ::Ping
BasicObject = ::BasicObject

Public Instance methods

[Validate]