vcr 1.11.3 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.travis.yml +6 -2
- data/CHANGELOG.md +49 -1
- data/Gemfile +1 -5
- data/Guardfile +0 -5
- data/README.md +3 -2
- data/Rakefile +11 -16
- data/cucumber.yml +0 -4
- data/features/.nav +14 -2
- data/features/cassettes/automatic_re_recording.feature +4 -6
- data/features/cassettes/dynamic_erb.feature +6 -8
- data/features/cassettes/exclusive.feature +111 -0
- data/features/cassettes/format.feature +16 -14
- data/features/cassettes/naming.feature +4 -6
- data/features/cassettes/no_cassette.feature +25 -28
- data/features/cassettes/update_content_length_header.feature +9 -9
- data/features/configuration/allow_http_connections_when_no_cassette.feature +6 -8
- data/features/configuration/cassette_library_dir.feature +4 -6
- data/features/configuration/default_cassette_options.feature +12 -10
- data/features/configuration/filter_sensitive_data.feature +12 -17
- data/features/configuration/{stub_with.feature → hook_into.feature} +63 -62
- data/features/configuration/hooks.feature +23 -33
- data/features/configuration/ignore_hosts.feature +16 -17
- data/features/configuration/ignore_localhost.feature +33 -42
- data/features/http_libraries/em_http_request.feature +7 -8
- data/features/http_libraries/net_http.feature +26 -28
- data/features/middleware/faraday.feature +17 -56
- data/features/middleware/rack.feature +8 -11
- data/features/record_modes/all.feature +5 -7
- data/features/record_modes/new_episodes.feature +5 -7
- data/features/record_modes/none.feature +6 -6
- data/features/record_modes/once.feature +6 -8
- data/features/request_matching/README.md +28 -0
- data/features/request_matching/body.feature +81 -0
- data/features/request_matching/custom_matcher.feature +125 -0
- data/features/request_matching/headers.feature +85 -0
- data/features/request_matching/host.feature +85 -0
- data/features/request_matching/identical_request_sequence.feature +79 -0
- data/features/request_matching/method.feature +86 -0
- data/features/request_matching/path.feature +86 -0
- data/features/request_matching/playback_repeats.feature +87 -0
- data/features/request_matching/uri.feature +84 -0
- data/features/request_matching/uri_without_param.feature +85 -0
- data/features/step_definitions/cli_steps.rb +4 -28
- data/features/support/env.rb +11 -9
- data/features/support/http_lib_filters.rb +2 -11
- data/features/support/vcr_cucumber_helpers.rb +4 -5
- data/features/test_frameworks/cucumber.feature +17 -18
- data/features/test_frameworks/rspec.feature +8 -12
- data/features/test_frameworks/shoulda.feature +5 -8
- data/features/test_frameworks/test_unit.feature +5 -8
- data/lib/vcr.rb +38 -58
- data/lib/vcr/cassette.rb +41 -60
- data/lib/vcr/cassette/http_interaction_list.rb +56 -0
- data/lib/vcr/cassette/reader.rb +29 -31
- data/lib/vcr/configuration.rb +76 -0
- data/lib/vcr/deprecations.rb +39 -0
- data/lib/vcr/errors.rb +22 -0
- data/lib/vcr/library_hooks.rb +19 -0
- data/lib/vcr/library_hooks/excon.rb +136 -0
- data/lib/vcr/library_hooks/fakeweb.rb +110 -0
- data/lib/vcr/library_hooks/faraday.rb +3 -0
- data/lib/vcr/library_hooks/typhoeus.rb +98 -0
- data/lib/vcr/library_hooks/webmock.rb +100 -0
- data/lib/vcr/middleware/faraday.rb +43 -36
- data/lib/vcr/middleware/rack.rb +28 -4
- data/lib/vcr/request_handler.rb +43 -0
- data/lib/vcr/request_ignorer.rb +31 -0
- data/lib/vcr/request_matcher_registry.rb +86 -0
- data/lib/vcr/structs/http_interaction.rb +24 -18
- data/lib/vcr/structs/normalizers/body.rb +1 -1
- data/lib/vcr/structs/normalizers/header.rb +1 -1
- data/lib/vcr/structs/normalizers/status_message.rb +1 -1
- data/lib/vcr/structs/normalizers/uri.rb +1 -1
- data/lib/vcr/structs/request.rb +0 -13
- data/lib/vcr/structs/response.rb +2 -9
- data/lib/vcr/structs/response_status.rb +0 -4
- data/lib/vcr/test_frameworks/cucumber.rb +1 -1
- data/lib/vcr/test_frameworks/rspec.rb +1 -1
- data/lib/vcr/util/hooks.rb +28 -19
- data/lib/vcr/util/internet_connection.rb +29 -2
- data/lib/vcr/util/version_checker.rb +60 -0
- data/lib/vcr/version.rb +1 -1
- data/script/FullBuildRakeFile +0 -7
- data/script/full_build +1 -1
- data/spec/capture_warnings.rb +36 -31
- data/spec/fixtures/{1.9.1/cassette_spec → cassette_spec}/empty.yml +0 -0
- data/spec/fixtures/{not_1.9.1/cassette_spec → cassette_spec}/example.yml +0 -0
- data/spec/fixtures/{not_1.9.1/cassette_spec → cassette_spec}/with_localhost_requests.yml +0 -0
- data/spec/fixtures/{not_1.9.1/fake_example.com_responses.yml → fake_example.com_responses.yml} +0 -0
- data/spec/fixtures/{not_1.9.1/match_requests_on.yml → match_requests_on.yml} +0 -0
- data/spec/monkey_patches.rb +40 -11
- data/spec/spec_helper.rb +7 -43
- data/spec/support/http_library_adapters.rb +3 -13
- data/spec/support/shared_example_groups/{http_library.rb → hook_into_http_library.rb} +39 -111
- data/spec/support/shared_example_groups/version_checking.rb +9 -9
- data/spec/vcr/cassette/http_interaction_list_spec.rb +178 -0
- data/spec/vcr/cassette/reader_spec.rb +2 -2
- data/spec/vcr/cassette_spec.rb +121 -156
- data/spec/vcr/configuration_spec.rb +143 -0
- data/spec/vcr/deprecations_spec.rb +91 -0
- data/spec/vcr/{http_stubbing_adapters → library_hooks}/excon_spec.rb +6 -9
- data/spec/vcr/library_hooks/fakeweb_spec.rb +83 -0
- data/spec/vcr/{http_stubbing_adapters → library_hooks}/typhoeus_spec.rb +7 -11
- data/spec/vcr/library_hooks/webmock_spec.rb +17 -0
- data/spec/vcr/library_hooks_spec.rb +51 -0
- data/spec/vcr/middleware/faraday_spec.rb +17 -44
- data/spec/vcr/middleware/rack_spec.rb +94 -58
- data/spec/vcr/request_ignorer_spec.rb +54 -0
- data/spec/vcr/request_matcher_registry_spec.rb +223 -0
- data/spec/vcr/structs/request_spec.rb +0 -33
- data/spec/vcr/structs/response_spec.rb +0 -24
- data/spec/vcr/structs/response_status_spec.rb +0 -9
- data/spec/vcr/util/hooks_spec.rb +3 -5
- data/spec/vcr/version_spec.rb +1 -1
- data/spec/vcr_spec.rb +79 -91
- data/vcr.gemspec +1 -1
- metadata +83 -103
- data/features/cassettes/request_matching.feature +0 -383
- data/lib/vcr/config.rb +0 -84
- data/lib/vcr/deprecations/cassette.rb +0 -29
- data/lib/vcr/deprecations/config.rb +0 -18
- data/lib/vcr/deprecations/http_stubbing_adapters/common.rb +0 -9
- data/lib/vcr/deprecations/http_stubbing_adapters/fakeweb.rb +0 -11
- data/lib/vcr/extensions/net_http.rb +0 -32
- data/lib/vcr/http_stubbing_adapters/common.rb +0 -202
- data/lib/vcr/http_stubbing_adapters/excon.rb +0 -178
- data/lib/vcr/http_stubbing_adapters/fakeweb.rb +0 -107
- data/lib/vcr/http_stubbing_adapters/faraday.rb +0 -26
- data/lib/vcr/http_stubbing_adapters/multi_object_proxy.rb +0 -43
- data/lib/vcr/http_stubbing_adapters/typhoeus.rb +0 -115
- data/lib/vcr/http_stubbing_adapters/webmock.rb +0 -120
- data/lib/vcr/middleware/cassette_arguments.rb +0 -19
- data/lib/vcr/middleware/common.rb +0 -20
- data/lib/vcr/request_matcher.rb +0 -94
- data/lib/vcr/rspec.rb +0 -2
- data/lib/vcr/util/basic_object.rb +0 -43
- data/lib/vcr/util/ping.rb +0 -30
- data/lib/vcr/util/regexes.rb +0 -37
- data/spec/fixtures/1.9.1/0_3_1_cassette.yml +0 -29
- data/spec/fixtures/1.9.1/cassette_spec/example.yml +0 -110
- data/spec/fixtures/1.9.1/cassette_spec/with_localhost_requests.yml +0 -109
- data/spec/fixtures/1.9.1/example_net_http.yml +0 -14
- data/spec/fixtures/1.9.1/example_net_http_request.yml +0 -12
- data/spec/fixtures/1.9.1/example_net_http_response.yml +0 -25
- data/spec/fixtures/1.9.1/fake_example.com_responses.yml +0 -108
- data/spec/fixtures/1.9.1/match_requests_on.yml +0 -185
- data/spec/fixtures/not_1.9.1/0_3_1_cassette.yml +0 -29
- data/spec/fixtures/not_1.9.1/cassette_spec/empty.yml +0 -0
- data/spec/fixtures/not_1.9.1/example_net_http.yml +0 -14
- data/spec/fixtures/not_1.9.1/example_net_http_request.yml +0 -12
- data/spec/fixtures/not_1.9.1/example_net_http_response.yml +0 -25
- data/spec/support/shared_example_groups/http_stubbing_adapter.rb +0 -133
- data/spec/support/shared_example_groups/ignore_localhost_deprecation.rb +0 -28
- data/spec/vcr/config_spec.rb +0 -181
- data/spec/vcr/deprecations/cassette_spec.rb +0 -57
- data/spec/vcr/deprecations/config_spec.rb +0 -30
- data/spec/vcr/deprecations/http_stubbing_adapters/common_spec.rb +0 -7
- data/spec/vcr/deprecations/http_stubbing_adapters/fakeweb_spec.rb +0 -16
- data/spec/vcr/extensions/net_http_spec.rb +0 -80
- data/spec/vcr/http_stubbing_adapters/fakeweb_spec.rb +0 -19
- data/spec/vcr/http_stubbing_adapters/faraday_spec.rb +0 -76
- data/spec/vcr/http_stubbing_adapters/multi_object_proxy_spec.rb +0 -101
- data/spec/vcr/http_stubbing_adapters/webmock_spec.rb +0 -17
- data/spec/vcr/middleware/cassette_arguments_spec.rb +0 -32
- data/spec/vcr/request_matcher_spec.rb +0 -230
data/lib/vcr/request_matcher.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'set'
|
2
|
-
|
3
|
-
module VCR
|
4
|
-
class RequestMatcher
|
5
|
-
VALID_MATCH_ATTRIBUTES = [:method, :uri, :host, :path, :headers, :body]
|
6
|
-
DEFAULT_MATCH_ATTRIBUTES = [:method, :uri]
|
7
|
-
|
8
|
-
attr_reader :request, :match_attributes
|
9
|
-
|
10
|
-
def initialize(request = nil, match_attributes = [])
|
11
|
-
if (match_attributes - VALID_MATCH_ATTRIBUTES).size > 0
|
12
|
-
raise ArgumentError.new("The only valid match_attributes options are: #{VALID_MATCH_ATTRIBUTES.inspect}. You passed: #{match_attributes.inspect}.")
|
13
|
-
end
|
14
|
-
|
15
|
-
@request, self.match_attributes = request, match_attributes
|
16
|
-
end
|
17
|
-
|
18
|
-
def match_attributes=(attributes)
|
19
|
-
# Unfortunately, 1.9.2 doesn't give the same hash code
|
20
|
-
# for two sets of the same elements unless they are ordered
|
21
|
-
# the same, so we sort the attributes here.
|
22
|
-
attributes = attributes.sort { |a, b| a.to_s <=> b.to_s }
|
23
|
-
@match_attributes = set(attributes)
|
24
|
-
end
|
25
|
-
|
26
|
-
def uri
|
27
|
-
return request.uri unless request.uri.is_a?(String)
|
28
|
-
uri_matchers = match_attributes.to_a & [:uri, :host, :path]
|
29
|
-
|
30
|
-
case set(uri_matchers)
|
31
|
-
when set then /.*/
|
32
|
-
when set(:uri) then request.uri
|
33
|
-
when set(:host) then VCR::Regexes.url_regex_for_hosts([URI(request.uri).host])
|
34
|
-
when set(:path) then VCR::Regexes.url_regex_for_path(URI(request.uri).path)
|
35
|
-
when set(:host, :path)
|
36
|
-
uri = URI(request.uri)
|
37
|
-
VCR::Regexes.url_regex_for_host_and_path(uri.host, uri.path)
|
38
|
-
else raise ArgumentError.new("match_attributes cannot include #{uri_matchers.join(' and ')}")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def method
|
43
|
-
request.method if match_requests_on?(:method)
|
44
|
-
end
|
45
|
-
|
46
|
-
def headers
|
47
|
-
request.headers if match_requests_on?(:headers)
|
48
|
-
end
|
49
|
-
|
50
|
-
def body
|
51
|
-
request.body if match_requests_on?(:body)
|
52
|
-
end
|
53
|
-
|
54
|
-
def match_requests_on?(attribute)
|
55
|
-
match_attributes.include?(attribute)
|
56
|
-
end
|
57
|
-
|
58
|
-
def eql?(other)
|
59
|
-
self == other
|
60
|
-
end
|
61
|
-
|
62
|
-
def ==(other)
|
63
|
-
%w( class match_attributes method uri headers body ).all? do |attr|
|
64
|
-
send(attr) == other.send(attr)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def hash
|
69
|
-
# on Ruby 1.8.6, identical sets have different hash values,
|
70
|
-
# but identical arrays have the same hash values,
|
71
|
-
# so we convert match_attributes to an array here.
|
72
|
-
[match_attributes.to_a, method, uri, sorted_header_array, body].hash
|
73
|
-
end
|
74
|
-
|
75
|
-
private
|
76
|
-
|
77
|
-
def set(*elements)
|
78
|
-
Set.new(elements.flatten)
|
79
|
-
end
|
80
|
-
|
81
|
-
def sorted_header_array
|
82
|
-
header_hash = headers
|
83
|
-
return header_hash unless header_hash.is_a?(Hash)
|
84
|
-
|
85
|
-
array = []
|
86
|
-
header_hash.each do |k, v|
|
87
|
-
v = v.sort if v.respond_to?(:sort)
|
88
|
-
array << [k, v]
|
89
|
-
end
|
90
|
-
|
91
|
-
array.sort! { |a1, a2| a1.first <=> a2.first }
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
data/lib/vcr/rspec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
module VCR
|
2
|
-
if defined?(::BasicObject)
|
3
|
-
BasicObject = ::BasicObject
|
4
|
-
else
|
5
|
-
# taken directly from backports:
|
6
|
-
# https://github.com/marcandre/backports/blob/v1.18.2/lib/backports/basic_object.rb
|
7
|
-
class BasicObject
|
8
|
-
KEEP = [:instance_eval, :instance_exec, :__send__,
|
9
|
-
"instance_eval", "instance_exec", "__send__"]
|
10
|
-
# undefine almost all instance methods
|
11
|
-
begin
|
12
|
-
old_verbose, $VERBOSE = $VERBOSE, nil # silence the warning for undefining __id__
|
13
|
-
(instance_methods - KEEP).each do |method|
|
14
|
-
undef_method method
|
15
|
-
end
|
16
|
-
ensure
|
17
|
-
$VERBOSE = old_verbose
|
18
|
-
end
|
19
|
-
|
20
|
-
class << self
|
21
|
-
def === (cmp)
|
22
|
-
true
|
23
|
-
end
|
24
|
-
|
25
|
-
# Let's try to keep things clean, in case methods have been added to Object
|
26
|
-
# either directly or through an included module.
|
27
|
-
# We'll do this whenever a class is derived from BasicObject
|
28
|
-
# Ideally, we'd do this by trapping Object.method_added
|
29
|
-
# and M.method_added for any module M included in Object or a submodule
|
30
|
-
# Seems really though to get right, but pull requests welcome ;-)
|
31
|
-
def inherited(sub)
|
32
|
-
BasicObject.class_eval do
|
33
|
-
(instance_methods - KEEP).each do |method|
|
34
|
-
if Object.method_defined?(method) && instance_method(method).owner == Object.instance_method(method).owner
|
35
|
-
undef_method method
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/lib/vcr/util/ping.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Ruby 1.8 provides Ping.pingecho, but it was removed in 1.9.
|
2
|
-
# So we try requiring it, and if that fails, define it ourselves.
|
3
|
-
|
4
|
-
module VCR
|
5
|
-
begin
|
6
|
-
require 'ping'
|
7
|
-
Ping = ::Ping
|
8
|
-
rescue LoadError
|
9
|
-
# This is copied, verbatim, from Ruby 1.8.7's ping.rb.
|
10
|
-
require 'timeout'
|
11
|
-
require "socket"
|
12
|
-
|
13
|
-
module Ping
|
14
|
-
def pingecho(host, timeout=5, service="echo")
|
15
|
-
begin
|
16
|
-
timeout(timeout) do
|
17
|
-
s = TCPSocket.new(host, service)
|
18
|
-
s.close
|
19
|
-
end
|
20
|
-
rescue Errno::ECONNREFUSED
|
21
|
-
return true
|
22
|
-
rescue Timeout::Error, StandardError
|
23
|
-
return false
|
24
|
-
end
|
25
|
-
return true
|
26
|
-
end
|
27
|
-
module_function :pingecho
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/lib/vcr/util/regexes.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
module VCR
|
2
|
-
module Regexes
|
3
|
-
extend self
|
4
|
-
|
5
|
-
PROTOCOL = '\Ahttps?://'
|
6
|
-
CREDENTIALS = '((\w+:)?\w+@)?'
|
7
|
-
PORT = '(:\d+)?'
|
8
|
-
THE_REST = '/?(\?.*)?\z'
|
9
|
-
|
10
|
-
@@url_host_regexes = Hash.new do |hash, hosts|
|
11
|
-
hash[hosts] = begin
|
12
|
-
host_regex = hosts.map { |h| Regexp.escape(h) }.join('|')
|
13
|
-
%r|#{PROTOCOL}#{CREDENTIALS}(#{host_regex})#{PORT}/|i
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def url_regex_for_hosts(hosts)
|
18
|
-
@@url_host_regexes[hosts.sort]
|
19
|
-
end
|
20
|
-
|
21
|
-
@@url_path_regexes = Hash.new do |hash, path|
|
22
|
-
%r|#{PROTOCOL}[^/]+#{Regexp.escape(path)}#{THE_REST}|i
|
23
|
-
end
|
24
|
-
|
25
|
-
def url_regex_for_path(path)
|
26
|
-
@@url_path_regexes[path]
|
27
|
-
end
|
28
|
-
|
29
|
-
@@url_host_and_path_regexes = Hash.new do |hash, (host, path)|
|
30
|
-
%r|#{PROTOCOL}#{CREDENTIALS}#{Regexp.escape(host)}#{PORT}#{Regexp.escape(path)}#{THE_REST}|i
|
31
|
-
end
|
32
|
-
|
33
|
-
def url_regex_for_host_and_path(host, path)
|
34
|
-
@@url_host_and_path_regexes[[host, path]]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- !ruby/struct:VCR::RecordedResponse
|
3
|
-
:method: :post
|
4
|
-
:uri: http://example.com:80/
|
5
|
-
:response: !ruby/object:Net::HTTPOK
|
6
|
-
body: The response from example.com
|
7
|
-
body_exist: true
|
8
|
-
code: "200"
|
9
|
-
header:
|
10
|
-
etag:
|
11
|
-
- "\"24ec5-1b6-4059a80bfd280\""
|
12
|
-
last-modified:
|
13
|
-
- Tue, 15 Nov 2005 13:24:10 GMT
|
14
|
-
content-type:
|
15
|
-
- text/html; charset=UTF-8
|
16
|
-
connection:
|
17
|
-
- close
|
18
|
-
server:
|
19
|
-
- Apache/2.2.3 (CentOS)
|
20
|
-
date:
|
21
|
-
- Wed, 31 Mar 2010 02:43:26 GMT
|
22
|
-
content-length:
|
23
|
-
- "438"
|
24
|
-
accept-ranges:
|
25
|
-
- bytes
|
26
|
-
http_version: "1.1"
|
27
|
-
message: OK
|
28
|
-
read: true
|
29
|
-
socket:
|
@@ -1,110 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- !ruby/struct:VCR::HTTPInteraction
|
3
|
-
:request: !ruby/struct:VCR::Request
|
4
|
-
:method: :get
|
5
|
-
:uri: http://example.com:80/
|
6
|
-
:body:
|
7
|
-
:headers:
|
8
|
-
:response: !ruby/struct:VCR::Response
|
9
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
10
|
-
:code: 200
|
11
|
-
:message: OK
|
12
|
-
:headers:
|
13
|
-
server:
|
14
|
-
- Apache/2.2.3 (Red Hat)
|
15
|
-
last-modified:
|
16
|
-
- Tue, 15 Nov 2005 13:24:10 GMT
|
17
|
-
etag:
|
18
|
-
- "\"b300b4-1b6-4059a80bfd280\""
|
19
|
-
accept-ranges:
|
20
|
-
- bytes
|
21
|
-
content-type:
|
22
|
-
- text/html; charset=UTF-8
|
23
|
-
connection:
|
24
|
-
- Keep-Alive
|
25
|
-
date:
|
26
|
-
- Mon, 25 Jan 2010 18:00:32 GMT
|
27
|
-
age:
|
28
|
-
- "2090"
|
29
|
-
content-length:
|
30
|
-
- "438"
|
31
|
-
:body: |
|
32
|
-
<HTML>
|
33
|
-
<HEAD>
|
34
|
-
<TITLE>Example Web Page</TITLE>
|
35
|
-
</HEAD>
|
36
|
-
<body>
|
37
|
-
<p>You have reached this web page by typing "example.com",
|
38
|
-
"example.net",
|
39
|
-
or "example.org" into your web browser.</p>
|
40
|
-
<p>These domain names are reserved for use in documentation and are not available
|
41
|
-
for registration. See <a href="http://www.rfc-editor.org/rfc/rfc2606.txt">RFC
|
42
|
-
2606</a>, Section 3.</p>
|
43
|
-
</BODY>
|
44
|
-
</HTML>
|
45
|
-
|
46
|
-
:http_version: "1.1"
|
47
|
-
- !ruby/struct:VCR::HTTPInteraction
|
48
|
-
:request: !ruby/struct:VCR::Request
|
49
|
-
:method: :get
|
50
|
-
:uri: http://example.com:80/foo
|
51
|
-
:body:
|
52
|
-
:headers:
|
53
|
-
:response: !ruby/struct:VCR::Response
|
54
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
55
|
-
:code: 404
|
56
|
-
:message: Not Found
|
57
|
-
:headers:
|
58
|
-
date:
|
59
|
-
- Mon, 25 Jan 2010 18:00:32 GMT
|
60
|
-
server:
|
61
|
-
- Apache/2.2.3 (CentOS)
|
62
|
-
content-length:
|
63
|
-
- "277"
|
64
|
-
connection:
|
65
|
-
- close
|
66
|
-
content-type:
|
67
|
-
- text/html; charset=iso-8859-1
|
68
|
-
:body: |
|
69
|
-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
70
|
-
<html><head>
|
71
|
-
<title>404 Not Found</title>
|
72
|
-
</head><body>
|
73
|
-
<h1>Not Found</h1>
|
74
|
-
<p>The requested URL /foo was not found on this server.</p>
|
75
|
-
<hr>
|
76
|
-
<address>Apache/2.2.3 (CentOS) Server at example.com Port 80</address>
|
77
|
-
</body></html>
|
78
|
-
|
79
|
-
:http_version: "1.1"
|
80
|
-
- !ruby/struct:VCR::HTTPInteraction
|
81
|
-
:request: !ruby/struct:VCR::Request
|
82
|
-
:method: :get
|
83
|
-
:uri: http://example.com:80/
|
84
|
-
:body:
|
85
|
-
:headers:
|
86
|
-
:response: !ruby/struct:VCR::Response
|
87
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
88
|
-
:code: 200
|
89
|
-
:message: OK
|
90
|
-
:headers:
|
91
|
-
server:
|
92
|
-
- Apache/2.2.3 (Red Hat)
|
93
|
-
last-modified:
|
94
|
-
- Tue, 15 Nov 2005 13:24:10 GMT
|
95
|
-
etag:
|
96
|
-
- "\"b300b4-1b6-4059a80bfd280\""
|
97
|
-
accept-ranges:
|
98
|
-
- bytes
|
99
|
-
content-type:
|
100
|
-
- text/html; charset=UTF-8
|
101
|
-
connection:
|
102
|
-
- Keep-Alive
|
103
|
-
date:
|
104
|
-
- Mon, 25 Jan 2010 18:00:32 GMT
|
105
|
-
age:
|
106
|
-
- "2090"
|
107
|
-
content-length:
|
108
|
-
- "438"
|
109
|
-
:body: Another example.com response
|
110
|
-
:http_version: "1.1"
|
@@ -1,109 +0,0 @@
|
|
1
|
-
---
|
2
|
-
- !ruby/struct:VCR::HTTPInteraction
|
3
|
-
:request: !ruby/struct:VCR::Request
|
4
|
-
:method: :get
|
5
|
-
:uri: http://localhost:80/
|
6
|
-
:body:
|
7
|
-
:headers:
|
8
|
-
:response: !ruby/struct:VCR::Response
|
9
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
10
|
-
:code: 200
|
11
|
-
:message: OK
|
12
|
-
:headers:
|
13
|
-
etag:
|
14
|
-
- "\"24ec5-1b6-4059a80bfd280\""
|
15
|
-
last-modified:
|
16
|
-
- Tue, 15 Nov 2005 13:24:10 GMT
|
17
|
-
connection:
|
18
|
-
- Keep-Alive
|
19
|
-
content-type:
|
20
|
-
- text/html; charset=UTF-8
|
21
|
-
date:
|
22
|
-
- Thu, 25 Feb 2010 07:53:51 GMT
|
23
|
-
server:
|
24
|
-
- Apache/2.2.3 (CentOS)
|
25
|
-
content-length:
|
26
|
-
- "438"
|
27
|
-
age:
|
28
|
-
- "9260"
|
29
|
-
accept-ranges:
|
30
|
-
- bytes
|
31
|
-
:body: Localhost response
|
32
|
-
:http_version: "1.1"
|
33
|
-
- !ruby/struct:VCR::HTTPInteraction
|
34
|
-
:request: !ruby/struct:VCR::Request
|
35
|
-
:method: :get
|
36
|
-
:uri: http://127.0.0.1:80/
|
37
|
-
:body:
|
38
|
-
:headers:
|
39
|
-
:response: !ruby/struct:VCR::Response
|
40
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
41
|
-
:code: 404
|
42
|
-
:message: Not Found
|
43
|
-
:headers:
|
44
|
-
content-type:
|
45
|
-
- text/html; charset=iso-8859-1
|
46
|
-
connection:
|
47
|
-
- close
|
48
|
-
server:
|
49
|
-
- Apache/2.2.3 (CentOS)
|
50
|
-
date:
|
51
|
-
- Thu, 25 Feb 2010 07:53:52 GMT
|
52
|
-
content-length:
|
53
|
-
- "277"
|
54
|
-
:body: 127.0.0.1 response
|
55
|
-
:http_version: "1.1"
|
56
|
-
- !ruby/struct:VCR::HTTPInteraction
|
57
|
-
:request: !ruby/struct:VCR::Request
|
58
|
-
:method: :get
|
59
|
-
:uri: http://0.0.0.0:80/
|
60
|
-
:body:
|
61
|
-
:headers:
|
62
|
-
:response: !ruby/struct:VCR::Response
|
63
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
64
|
-
:code: 404
|
65
|
-
:message: Not Found
|
66
|
-
:headers:
|
67
|
-
content-type:
|
68
|
-
- text/html; charset=iso-8859-1
|
69
|
-
connection:
|
70
|
-
- close
|
71
|
-
server:
|
72
|
-
- Apache/2.2.3 (CentOS)
|
73
|
-
date:
|
74
|
-
- Thu, 25 Feb 2010 07:53:52 GMT
|
75
|
-
content-length:
|
76
|
-
- "277"
|
77
|
-
:body: 127.0.0.1 response
|
78
|
-
:http_version: "1.1"
|
79
|
-
- !ruby/struct:VCR::HTTPInteraction
|
80
|
-
:request: !ruby/struct:VCR::Request
|
81
|
-
:method: :get
|
82
|
-
:uri: http://example.com:80/
|
83
|
-
:body:
|
84
|
-
:headers:
|
85
|
-
:response: !ruby/struct:VCR::Response
|
86
|
-
:status: !ruby/struct:VCR::ResponseStatus
|
87
|
-
:code: 200
|
88
|
-
:message: OK
|
89
|
-
:headers:
|
90
|
-
etag:
|
91
|
-
- "\"24ec5-1b6-4059a80bfd280\""
|
92
|
-
last-modified:
|
93
|
-
- Tue, 15 Nov 2005 13:24:10 GMT
|
94
|
-
connection:
|
95
|
-
- Keep-Alive
|
96
|
-
content-type:
|
97
|
-
- text/html; charset=UTF-8
|
98
|
-
date:
|
99
|
-
- Thu, 25 Feb 2010 07:53:51 GMT
|
100
|
-
server:
|
101
|
-
- Apache/2.2.3 (CentOS)
|
102
|
-
content-length:
|
103
|
-
- "438"
|
104
|
-
age:
|
105
|
-
- "9260"
|
106
|
-
accept-ranges:
|
107
|
-
- bytes
|
108
|
-
:body: example.com response
|
109
|
-
:http_version: "1.1"
|