Module WebMock
In: lib/webmock/http_lib_adapters/net_http.rb
lib/webmock/http_lib_adapters/net_http_response.rb
lib/webmock/rspec/matchers/webmock_matcher.rb
lib/webmock/rspec/matchers/request_pattern_matcher.rb
lib/webmock/rspec/matchers.rb
lib/webmock/responses_sequence.rb
lib/webmock/version.rb
lib/webmock/util/hash_keys_stringifier.rb
lib/webmock/util/headers.rb
lib/webmock/util/hash_counter.rb
lib/webmock/util/uri.rb
lib/webmock/callback_registry.rb
lib/webmock/request_pattern.rb
lib/webmock/request_signature.rb
lib/webmock/stub_request_snippet.rb
lib/webmock/webmock.rb
lib/webmock/stub_registry.rb
lib/webmock/errors.rb
lib/webmock/response.rb
lib/webmock/request_execution_verifier.rb
lib/webmock/config.rb
lib/webmock/api.rb
lib/webmock/request_stub.rb
lib/webmock/request_registry.rb
lib/webmock/deprecation.rb
lib/webmock/assertion_failure.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

WebMock::API

Classes and Modules

Module WebMock::API
Module WebMock::Matchers
Module WebMock::Net
Module WebMock::NetHTTPUtility
Module WebMock::Util
Class WebMock::AssertionFailure
Class WebMock::BodyPattern
Class WebMock::CallbackRegistry
Class WebMock::Config
Class WebMock::Deprecation
Class WebMock::DynamicResponse
Class WebMock::HeadersPattern
Class WebMock::MethodPattern
Class WebMock::NetConnectNotAllowedError
Class WebMock::RequestExecutionVerifier
Class WebMock::RequestPattern
Class WebMock::RequestPatternMatcher
Class WebMock::RequestRegistry
Class WebMock::RequestSignature
Class WebMock::RequestStub
Class WebMock::Response
Class WebMock::ResponseFactory
Class WebMock::ResponsesSequence
Class WebMock::StubRegistry
Class WebMock::StubRequestSnippet
Class WebMock::URIPattern
Class WebMock::URIRegexpPattern
Class WebMock::URIStringPattern
Class WebMock::WebMockMatcher

Constants

VERSION = '1.6.4'

External Aliases

a_request -> request

Public Class methods

Public Instance methods

[Validate]