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
@@ -1,4 +1,10 @@
|
|
1
1
|
require 'forwardable'
|
2
|
+
require 'vcr/structs/normalizers/body'
|
3
|
+
require 'vcr/structs/normalizers/header'
|
4
|
+
require 'vcr/structs/normalizers/status_message'
|
5
|
+
require 'vcr/structs/normalizers/uri'
|
6
|
+
require 'vcr/structs/request'
|
7
|
+
require 'vcr/structs/response'
|
2
8
|
|
3
9
|
module VCR
|
4
10
|
class HTTPInteraction < Struct.new(:request, :response)
|
@@ -25,28 +31,28 @@ module VCR
|
|
25
31
|
filter_object!(self, text, replacement_text)
|
26
32
|
end
|
27
33
|
|
28
|
-
|
34
|
+
private
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
object
|
36
|
+
def filter_object!(object, text, replacement_text)
|
37
|
+
if object.respond_to?(:gsub)
|
38
|
+
object.gsub!(text, replacement_text) if object.include?(text)
|
39
|
+
elsif Hash === object
|
40
|
+
filter_hash!(object, text, replacement_text)
|
41
|
+
elsif object.respond_to?(:each)
|
42
|
+
# This handles nested arrays and structs
|
43
|
+
object.each { |o| filter_object!(o, text, replacement_text) }
|
41
44
|
end
|
42
45
|
|
43
|
-
|
44
|
-
|
46
|
+
object
|
47
|
+
end
|
48
|
+
|
49
|
+
def filter_hash!(hash, text, replacement_text)
|
50
|
+
filter_object!(hash.values, text, replacement_text)
|
45
51
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
52
|
+
hash.keys.each do |k|
|
53
|
+
new_key = filter_object!(k.dup, text, replacement_text)
|
54
|
+
hash[new_key] = hash.delete(k) unless k == new_key
|
50
55
|
end
|
56
|
+
end
|
51
57
|
end
|
52
58
|
end
|
data/lib/vcr/structs/request.rb
CHANGED
@@ -4,23 +4,10 @@ module VCR
|
|
4
4
|
include Normalizers::URI
|
5
5
|
include Normalizers::Body
|
6
6
|
|
7
|
-
def self.from_net_http_request(net_http, request)
|
8
|
-
new(
|
9
|
-
request.method.downcase.to_sym,
|
10
|
-
VCR.http_stubbing_adapter.request_uri(net_http, request),
|
11
|
-
request.body,
|
12
|
-
request.to_hash
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
7
|
@@object_method = Object.instance_method(:method)
|
17
8
|
def method(*args)
|
18
9
|
return super if args.empty?
|
19
10
|
@@object_method.bind(self).call(*args)
|
20
11
|
end
|
21
|
-
|
22
|
-
def matcher(match_attributes)
|
23
|
-
RequestMatcher.new(self, match_attributes)
|
24
|
-
end
|
25
12
|
end
|
26
13
|
end
|
data/lib/vcr/structs/response.rb
CHANGED
@@ -1,17 +1,10 @@
|
|
1
|
+
require 'vcr/structs/response_status'
|
2
|
+
|
1
3
|
module VCR
|
2
4
|
class Response < Struct.new(:status, :headers, :body, :http_version)
|
3
5
|
include Normalizers::Header
|
4
6
|
include Normalizers::Body
|
5
7
|
|
6
|
-
def self.from_net_http_response(response)
|
7
|
-
new(
|
8
|
-
ResponseStatus.from_net_http_response(response),
|
9
|
-
response.to_hash,
|
10
|
-
response.body,
|
11
|
-
response.http_version
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
8
|
def update_content_length_header
|
16
9
|
headers['content-length'] &&= [body ? body.length.to_s : '0']
|
17
10
|
end
|
@@ -18,7 +18,7 @@ module VCR
|
|
18
18
|
def tags(*tag_names)
|
19
19
|
options = tag_names.last.is_a?(::Hash) ? tag_names.pop : {}
|
20
20
|
tag_names.each do |tag_name|
|
21
|
-
tag_name = "@#{tag_name}" unless tag_name =~
|
21
|
+
tag_name = "@#{tag_name}" unless tag_name =~ /\A@/
|
22
22
|
cassette_name = "cucumber_tags/#{tag_name.gsub(/\A@/, '')}"
|
23
23
|
|
24
24
|
# It would be nice to use an Around hook here, but
|
data/lib/vcr/util/hooks.rb
CHANGED
@@ -2,7 +2,11 @@ module VCR
|
|
2
2
|
module Hooks
|
3
3
|
include VariableArgsBlockCaller
|
4
4
|
|
5
|
-
def
|
5
|
+
def self.included(klass)
|
6
|
+
klass.extend(ClassMethods)
|
7
|
+
end
|
8
|
+
|
9
|
+
def invoke_hook(hook, tag=nil, *args)
|
6
10
|
hooks_for(hook, tag).each do |callback|
|
7
11
|
call_block(callback, *args)
|
8
12
|
end
|
@@ -12,31 +16,36 @@ module VCR
|
|
12
16
|
hooks.clear
|
13
17
|
end
|
14
18
|
|
15
|
-
|
19
|
+
private
|
16
20
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
21
|
+
def hooks
|
22
|
+
@hooks ||= Hash.new do |hook_type_hash, hook_type|
|
23
|
+
hook_type_hash[hook_type] = Hash.new do |tag_hash, tag|
|
24
|
+
tag_hash[tag] = []
|
22
25
|
end
|
23
26
|
end
|
27
|
+
end
|
24
28
|
|
29
|
+
def hooks_for(hook, tag)
|
30
|
+
for_hook = hooks[hook]
|
31
|
+
hooks = for_hook[tag] # matching tagged hooks
|
32
|
+
hooks += for_hook[nil] unless tag.nil? # untagged hooks
|
33
|
+
hooks
|
34
|
+
end
|
35
|
+
|
36
|
+
module ClassMethods
|
25
37
|
def define_hook(hook)
|
26
|
-
# We
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
38
|
+
# We use splat args here because 1.8.7 doesn't allow default
|
39
|
+
# values for block arguments, so we have to fake it.
|
40
|
+
define_method hook do |*args, &block|
|
41
|
+
if args.size > 1
|
42
|
+
raise ArgumentError.new("wrong number of arguments (#{args.size} for 1)")
|
31
43
|
end
|
32
|
-
RUBY
|
33
|
-
end
|
34
44
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
hooks += for_hook[nil] unless tag.nil? # untagged hooks
|
39
|
-
hooks
|
45
|
+
tag = args.first
|
46
|
+
hooks[hook][tag] << block
|
47
|
+
end
|
40
48
|
end
|
49
|
+
end
|
41
50
|
end
|
42
51
|
end
|
@@ -1,6 +1,32 @@
|
|
1
|
-
require 'vcr/util/ping'
|
2
|
-
|
3
1
|
module VCR
|
2
|
+
# Ruby 1.8 provides Ping.pingecho, but it was removed in 1.9.
|
3
|
+
# So we try requiring it, and if that fails, define it ourselves.
|
4
|
+
begin
|
5
|
+
require 'ping'
|
6
|
+
Ping = ::Ping
|
7
|
+
rescue LoadError
|
8
|
+
# This is copied, verbatim, from Ruby 1.8.7's ping.rb.
|
9
|
+
require 'timeout'
|
10
|
+
require "socket"
|
11
|
+
|
12
|
+
module Ping
|
13
|
+
def pingecho(host, timeout=5, service="echo")
|
14
|
+
begin
|
15
|
+
timeout(timeout) do
|
16
|
+
s = TCPSocket.new(host, service)
|
17
|
+
s.close
|
18
|
+
end
|
19
|
+
rescue Errno::ECONNREFUSED
|
20
|
+
return true
|
21
|
+
rescue Timeout::Error, StandardError
|
22
|
+
return false
|
23
|
+
end
|
24
|
+
return true
|
25
|
+
end
|
26
|
+
module_function :pingecho
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
4
30
|
module InternetConnection
|
5
31
|
extend self
|
6
32
|
|
@@ -12,3 +38,4 @@ module VCR
|
|
12
38
|
end
|
13
39
|
end
|
14
40
|
end
|
41
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module VCR
|
2
|
+
class VersionChecker
|
3
|
+
def initialize(library_name, library_version, min_patch_level, max_minor_version)
|
4
|
+
@library_name, @library_version = library_name, library_version
|
5
|
+
@min_patch_level, @max_minor_version = min_patch_level, max_minor_version
|
6
|
+
|
7
|
+
@major, @minor, @patch = parse_version(library_version)
|
8
|
+
@min_major, @min_minor, @min_patch = parse_version(min_patch_level)
|
9
|
+
@max_major, @max_minor = parse_version(max_minor_version)
|
10
|
+
|
11
|
+
@comparison_result = compare_version
|
12
|
+
end
|
13
|
+
|
14
|
+
def check_version!
|
15
|
+
raise_too_low_error if too_low?
|
16
|
+
warn_about_too_high if too_high?
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def too_low?
|
22
|
+
@comparison_result == :too_low
|
23
|
+
end
|
24
|
+
|
25
|
+
def too_high?
|
26
|
+
@comparison_result == :too_high
|
27
|
+
end
|
28
|
+
|
29
|
+
def raise_too_low_error
|
30
|
+
raise Errors::LibraryVersionTooLowError,
|
31
|
+
"You are using #{@library_name} #{@library_version}. " +
|
32
|
+
"VCR requires version #{version_requirement}."
|
33
|
+
end
|
34
|
+
|
35
|
+
def warn_about_too_high
|
36
|
+
Kernel.warn "You are using #{@library_name} #{@library_version}. " +
|
37
|
+
"VCR is known to work with #{@library_name} #{version_requirement}. " +
|
38
|
+
"It may not work with this version."
|
39
|
+
end
|
40
|
+
|
41
|
+
def compare_version
|
42
|
+
case
|
43
|
+
when @major < @min_major then :too_low
|
44
|
+
when @major > @max_major then :too_high
|
45
|
+
when @minor < @min_minor then :too_low
|
46
|
+
when @minor > @max_minor then :too_high
|
47
|
+
when @patch < @min_patch then :too_low
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def version_requirement
|
52
|
+
">= #{@min_patch_level}, < #{@max_major}.#{@max_minor + 1}"
|
53
|
+
end
|
54
|
+
|
55
|
+
def parse_version(version)
|
56
|
+
version.split('.').map { |v| v.to_i }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
data/lib/vcr/version.rb
CHANGED
data/script/FullBuildRakeFile
CHANGED
@@ -37,13 +37,6 @@ task :print_ruby_description do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
task :bundle_install => :ensure_bundler_installed do
|
40
|
-
# Unfortunately, there is no version of ruby-debug that installs cleanly on 1.9.1 and 1.9.2.
|
41
|
-
# Our Gemfile specifies different versions using conditionals, but we still need to bundle update
|
42
|
-
# to get bundler to use the different versions.
|
43
|
-
if RUBY_VERSION =~ /^1\.9/
|
44
|
-
sh "bundle update ruby-debug-base19"
|
45
|
-
end
|
46
|
-
|
47
40
|
sh "bundle install"
|
48
41
|
end
|
49
42
|
|
data/script/full_build
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm 1.8.
|
1
|
+
rvm 1.8.7,1.9.2,ree,rbx rake -f script/FullBuildRakeFile build | tee tmp/full_build.out
|
data/spec/capture_warnings.rb
CHANGED
@@ -3,40 +3,45 @@ stderr_file = Tempfile.new("vcr.stderr")
|
|
3
3
|
$stderr.reopen(stderr_file.path)
|
4
4
|
current_dir = Dir.pwd
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
6
|
+
require 'rubygems' if RUBY_VERSION =~ /^1\.8/
|
7
|
+
require 'rspec/core'
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.after(:suite) do
|
11
|
+
stderr_file.rewind
|
12
|
+
lines = stderr_file.read.split("\n").uniq
|
13
|
+
stderr_file.close!
|
14
|
+
|
15
|
+
vcr_warnings, other_warnings = lines.partition { |line| line.include?(current_dir) }
|
16
|
+
|
17
|
+
# For some weird reason, JRuby is giving me some warnings about
|
18
|
+
# `@proxy` not being initialized, and putting a vcr file/line number
|
19
|
+
# in the warning, but it's really happening in excon.
|
20
|
+
if RUBY_PLATFORM == 'java'
|
21
|
+
vcr_warnings.reject! do |line|
|
22
|
+
line.include?('@proxy not initialized') && line.include?('excon')
|
23
|
+
end
|
19
24
|
end
|
20
|
-
end
|
21
25
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
if vcr_warnings.any?
|
27
|
+
puts
|
28
|
+
puts "-" * 30 + " VCR Warnings: " + "-" * 30
|
29
|
+
puts
|
30
|
+
puts vcr_warnings.join("\n")
|
31
|
+
puts
|
32
|
+
puts "-" * 75
|
33
|
+
puts
|
34
|
+
end
|
31
35
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
if other_warnings.any?
|
37
|
+
File.open('tmp/warnings.txt', 'w') { |f| f.write(other_warnings.join("\n")) }
|
38
|
+
puts
|
39
|
+
puts "Non-VCR warnings written to tmp/warnings.txt"
|
40
|
+
puts
|
41
|
+
end
|
38
42
|
|
39
|
-
|
40
|
-
|
43
|
+
# fail the build...
|
44
|
+
raise "Failing build due to VCR warnings" if vcr_warnings.any?
|
45
|
+
end
|
41
46
|
end
|
42
47
|
|