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

Classes and Modules

Module WebMock::Matchers
Module WebMock::Net
Module WebMock::NetHTTPUtility
Module WebMock::Util
Class WebMock::BodyPattern
Class WebMock::CallbackRegistry
Class WebMock::Config
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::URIPattern
Class WebMock::URIRegexpPattern
Class WebMock::URIStringPattern
Class WebMock::WebMockMatcher

Constants

AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat

Public Class methods

Public Instance methods

stub_http_request(method, uri)

Alias for stub_request

[Validate]