vcr 2.9.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/about_these_examples.md +1 -1
- data/features/cassettes/automatic_re_recording.feature +4 -4
- data/features/cassettes/decompress.feature +3 -3
- data/features/cassettes/exclusive.feature +11 -8
- data/features/cassettes/format.feature +135 -32
- data/features/cassettes/naming.feature +2 -2
- data/features/cassettes/no_cassette.feature +4 -4
- data/features/configuration/allow_http_connections_when_no_cassette.feature +6 -3
- data/features/configuration/cassette_library_dir.feature +2 -2
- data/features/configuration/debug_logging.feature +15 -8
- data/features/configuration/filter_sensitive_data.feature +8 -7
- data/features/configuration/hook_into.feature +8 -8
- data/features/configuration/ignore_request.feature +13 -14
- data/features/configuration/preserve_exact_body_bytes.feature +5 -5
- data/features/configuration/uri_parser.feature +15 -11
- data/features/hooks/after_http_request.feature +5 -4
- data/features/hooks/around_http_request.feature +3 -3
- data/features/hooks/before_http_request.feature +4 -2
- data/features/hooks/before_playback.feature +14 -15
- data/features/hooks/before_record.feature +10 -10
- data/features/http_libraries/em_http_request.feature +6 -3
- data/features/http_libraries/net_http.feature +15 -5
- data/features/middleware/faraday.feature +2 -2
- data/features/middleware/rack.feature +4 -4
- data/features/record_modes/all.feature +5 -5
- data/features/record_modes/new_episodes.feature +2 -2
- data/features/record_modes/once.feature +3 -3
- data/features/step_definitions/cli_steps.rb +37 -39
- data/features/support/env.rb +29 -26
- data/features/support/http_lib_filters.rb +0 -7
- data/features/test_frameworks/cucumber.feature +11 -10
- data/features/test_frameworks/rspec_macro.feature +5 -30
- data/features/test_frameworks/rspec_metadata.feature +9 -8
- data/features/test_frameworks/test_unit.feature +5 -2
- data/lib/vcr.rb +86 -14
- data/lib/vcr/cassette.rb +4 -2
- data/lib/vcr/cassette/serializers.rb +10 -8
- data/lib/vcr/cassette/serializers/compressed.rb +45 -0
- data/lib/vcr/configuration.rb +38 -17
- data/lib/vcr/library_hooks/fakeweb.rb +1 -0
- data/lib/vcr/library_hooks/faraday.rb +5 -1
- data/lib/vcr/middleware/faraday.rb +13 -9
- data/lib/vcr/test_frameworks/cucumber.rb +39 -5
- data/lib/vcr/version.rb +1 -1
- data/spec/acceptance/concurrency_spec.rb +51 -0
- data/spec/{vcr → lib/vcr}/cassette/erb_renderer_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/http_interaction_list_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/migrator_spec.rb +10 -9
- data/spec/{vcr → lib/vcr}/cassette/persisters/file_system_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/persisters_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/serializers_spec.rb +8 -2
- data/spec/{vcr → lib/vcr}/cassette_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/configuration_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/deprecations_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/errors_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/extensions/net_http_response_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/excon_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/fakeweb_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/faraday_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/typhoeus_0.4_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/typhoeus_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/webmock_spec.rb +2 -2
- data/spec/{vcr → lib/vcr}/library_hooks_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/middleware/faraday_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/middleware/rack_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/request_ignorer_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/request_matcher_registry_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/structs_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/test_frameworks/cucumber_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/test_frameworks/rspec_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/hooks_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/internet_connection_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/version_checker_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/version_spec.rb +0 -0
- data/spec/{vcr_spec.rb → lib/vcr_spec.rb} +2 -2
- data/spec/spec_helper.rb +21 -50
- data/spec/support/cucumber_helpers.rb +39 -0
- data/spec/support/limited_uri.rb +1 -11
- data/spec/support/shared_example_groups/hook_into_http_library.rb +2 -1
- data/spec/support/vcr_localhost_server.rb +2 -3
- metadata +475 -123
- data/.gemtest +0 -0
- data/.gitignore +0 -52
- data/.gitmodules +0 -3
- data/.rspec +0 -2
- data/.travis.yml +0 -27
- data/.yardopts +0 -9
- data/Appraisals +0 -5
- data/CHANGELOG.md +0 -987
- data/CONTRIBUTING.md +0 -26
- data/Gemfile +0 -54
- data/Gemfile.lock +0 -159
- data/LICENSE +0 -20
- data/README.md +0 -243
- data/Rakefile +0 -197
- data/Upgrade.md +0 -289
- data/benchmarks/http_stubbing_libraries.rb +0 -59
- data/benchmarks/null_logging.rb +0 -62
- data/cucumber.yml +0 -16
- data/features/.nav +0 -62
- data/features/cassettes/persistence.feature +0 -63
- data/features/support/vcr_cucumber_helpers.rb +0 -46
- data/gemfiles/typhoeus_old.gemfile +0 -34
- data/gemfiles/typhoeus_old.gemfile.lock +0 -133
- data/script/ci.sh +0 -27
- data/spec/capture_warnings.rb +0 -73
- data/spec/quality_spec.rb +0 -51
- data/vcr.gemspec +0 -23
data/script/ci.sh
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# Kill the whole script on error
|
2
|
-
set -e -x
|
3
|
-
|
4
|
-
# idea taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
|
5
|
-
export JRUBY_OPTS='-X-C' # disable JIT since these processes are so short lived
|
6
|
-
|
7
|
-
# force jRuby to use client mode JVM or a compilation mode thats as close as possible,
|
8
|
-
# idea taken from https://github.com/jruby/jruby/wiki/Improving-startup-time
|
9
|
-
export JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1'
|
10
|
-
|
11
|
-
echo "-------- Running Typhoeus 0.4 Specs ---------"
|
12
|
-
bundle install --gemfile=gemfiles/typhoeus_old.gemfile --without extras
|
13
|
-
BUNDLE_GEMFILE=gemfiles/typhoeus_old.gemfile bundle exec rspec spec/vcr/library_hooks/typhoeus_0.4_spec.rb --format progress --backtrace
|
14
|
-
|
15
|
-
# Setup vendored rspec-1
|
16
|
-
bundle exec rake submodules
|
17
|
-
|
18
|
-
echo "-------- Running Specs ---------"
|
19
|
-
bundle exec ruby -I./spec -r./spec/capture_warnings -rspec_helper -S rspec spec --format progress --backtrace
|
20
|
-
|
21
|
-
echo "-------- Running Cukes ---------"
|
22
|
-
bundle exec cucumber
|
23
|
-
|
24
|
-
echo "-------- Checking Coverage ---------"
|
25
|
-
bundle exec rake yard_coverage
|
26
|
-
|
27
|
-
bundle exec rake check_code_coverage
|
data/spec/capture_warnings.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'rubygems' if RUBY_VERSION =~ /^1\.8/
|
2
|
-
require 'bundler/setup'
|
3
|
-
require 'rspec/core'
|
4
|
-
require 'rspec/expectations'
|
5
|
-
require 'tempfile'
|
6
|
-
|
7
|
-
stderr_file = Tempfile.new("vcr.stderr")
|
8
|
-
current_dir = Dir.pwd
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
config.before(:suite) do
|
12
|
-
$stderr.reopen(stderr_file.path)
|
13
|
-
$VERBOSE = true
|
14
|
-
end
|
15
|
-
|
16
|
-
config.after(:suite) do
|
17
|
-
stderr_file.rewind
|
18
|
-
lines = stderr_file.read.split("\n").uniq
|
19
|
-
stderr_file.close!
|
20
|
-
|
21
|
-
$stderr.reopen(STDERR)
|
22
|
-
|
23
|
-
vcr_warnings, other_warnings = lines.partition { |line| line.include?(current_dir) }
|
24
|
-
|
25
|
-
# After upgrading to curb 0.8.1, I started to get a circular require
|
26
|
-
# warning from spec_helper and monkey_patches.rb even though there doesn't
|
27
|
-
# appear to be a circular require going on...
|
28
|
-
vcr_warnings.reject! do |line|
|
29
|
-
line.include?("#{current_dir}/spec/spec_helper.rb") ||
|
30
|
-
line.include?("#{current_dir}/spec/monkey_patches.rb")
|
31
|
-
end
|
32
|
-
|
33
|
-
# For some weird reason, JRuby is giving me some warnings about
|
34
|
-
# `@proxy` not being initialized, and putting a vcr file/line number
|
35
|
-
# in the warning, but it's really happening in excon.
|
36
|
-
if RUBY_PLATFORM == 'java'
|
37
|
-
vcr_warnings.reject! do |line|
|
38
|
-
line.include?('@proxy not initialized') && line.include?('excon')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# For some reason, I get a strange warning on 1.9.2 on Travis-CI but
|
43
|
-
# I can't repro locally:
|
44
|
-
# from /home/travis/builds/myronmarston/vcr/spec/monkey_pnet/http:
|
45
|
-
# warning: Content-Type did not set; using application/x-www-form-urlencoded
|
46
|
-
if RUBY_VERSION == '1.9.2' && ENV['CI']
|
47
|
-
vcr_warnings.reject! do |line|
|
48
|
-
line.include?('monkey_pnet')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
if vcr_warnings.any?
|
53
|
-
puts
|
54
|
-
puts "-" * 30 + " VCR Warnings: " + "-" * 30
|
55
|
-
puts
|
56
|
-
puts vcr_warnings.join("\n")
|
57
|
-
puts
|
58
|
-
puts "-" * 75
|
59
|
-
puts
|
60
|
-
end
|
61
|
-
|
62
|
-
if other_warnings.any?
|
63
|
-
File.open('tmp/warnings.txt', 'w') { |f| f.write(other_warnings.join("\n")) }
|
64
|
-
puts
|
65
|
-
puts "Non-VCR warnings written to tmp/warnings.txt"
|
66
|
-
puts
|
67
|
-
end
|
68
|
-
|
69
|
-
# fail the build...
|
70
|
-
raise "Failing build due to VCR warnings" if vcr_warnings.any?
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
data/spec/quality_spec.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# Borrowed from:
|
2
|
-
# https://github.com/carlhuda/bundler/blob/v1.1.rc.7/spec/quality_spec.rb
|
3
|
-
require "spec_helper"
|
4
|
-
|
5
|
-
describe "The library itself" do
|
6
|
-
def check_for_tab_characters(filename)
|
7
|
-
failing_lines = []
|
8
|
-
File.readlines(filename).each_with_index do |line,number|
|
9
|
-
failing_lines << number + 1 if line =~ /\t/
|
10
|
-
end
|
11
|
-
|
12
|
-
unless failing_lines.empty?
|
13
|
-
"#{filename} has tab characters on lines #{failing_lines.join(', ')}"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def check_for_extra_spaces(filename)
|
18
|
-
failing_lines = []
|
19
|
-
File.readlines(filename).each_with_index do |line,number|
|
20
|
-
next if line =~ /^\s+#.*\s+\n$/
|
21
|
-
failing_lines << number + 1 if line =~ /\s+\n$/
|
22
|
-
end
|
23
|
-
|
24
|
-
unless failing_lines.empty?
|
25
|
-
"#{filename} has spaces on the EOL on lines #{failing_lines.join(', ')}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
RSpec::Matchers.define :be_well_formed do
|
30
|
-
failure_message do |actual|
|
31
|
-
actual.join("\n")
|
32
|
-
end
|
33
|
-
|
34
|
-
match do |actual|
|
35
|
-
actual.empty?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
it "has no malformed whitespace" do
|
40
|
-
error_messages = []
|
41
|
-
Dir.chdir(File.expand_path("../..", __FILE__)) do
|
42
|
-
`git ls-files`.split("\n").each do |filename|
|
43
|
-
next if filename =~ /vendor|.feature|.yml|.gitmodules/
|
44
|
-
error_messages << check_for_tab_characters(filename)
|
45
|
-
error_messages << check_for_extra_spaces(filename)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
expect(error_messages.compact).to be_well_formed
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
data/vcr.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
-
require "vcr/version"
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.name = "vcr"
|
6
|
-
s.homepage = "https://github.com/vcr/vcr"
|
7
|
-
s.license = "MIT"
|
8
|
-
s.authors = ["Myron Marston"]
|
9
|
-
s.summary = "Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests."
|
10
|
-
s.description = "VCR provides a simple API to record and replay your test suite's HTTP interactions. It works with a variety of HTTP client libraries, HTTP stubbing libraries and testing frameworks."
|
11
|
-
s.email = "myron.marston@gmail.com"
|
12
|
-
s.require_path = "lib"
|
13
|
-
s.files = `git ls-files`.split("\n")
|
14
|
-
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
|
15
|
-
|
16
|
-
s.version = VCR.version
|
17
|
-
s.platform = Gem::Platform::RUBY
|
18
|
-
s.required_ruby_version = '>= 1.8.7'
|
19
|
-
s.required_rubygems_version = '>= 1.3.5'
|
20
|
-
|
21
|
-
# Development dependencies are listed in the Gemfile.
|
22
|
-
end
|
23
|
-
|