nxt_vcr_harness 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +23 -23
- data/README.md +3 -2
- data/lib/nxt_vcr_harness.rb +4 -3
- data/lib/nxt_vcr_harness/version.rb +1 -1
- data/nxt_vcr_harness.gemspec +4 -3
- metadata +11 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32922bec1636e50f2f5e1493bb2b339a7b9f071a17f514afe5cae0ac37ed2889
|
|
4
|
+
data.tar.gz: 38defb9a3f01355347395709dff2cbc2e23d06126a43c03806d7aa20c93f4ce5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d91532d74bb9a2ca0ef9c9ad680bdd7fe1cc73ad9a896f3a0b8f144fdf167f48a96d7aef98ebece806e77e45682a795eb332eabd18ba3b91a2e9ecacf456465a
|
|
7
|
+
data.tar.gz: dd5e99a7d29f9aee781fae2d3be7a3a7bd65023785547d44d0845fb9acf500cee23208d6fe9f28fd2505d1d02fc3a618155db6efb4c221676c2220632c06d468
|
data/.circleci/config.yml
CHANGED
|
@@ -4,11 +4,12 @@ jobs:
|
|
|
4
4
|
build:
|
|
5
5
|
working_directory: /home/circleci/app
|
|
6
6
|
docker:
|
|
7
|
-
- image: circleci/ruby:2.
|
|
7
|
+
- image: circleci/ruby:2.7.2-node
|
|
8
8
|
environment:
|
|
9
9
|
RACK_ENV: test
|
|
10
10
|
RAILS_ENV: test
|
|
11
11
|
COVERAGE: true
|
|
12
|
+
BUNDLER_VERSION: 2.1.4
|
|
12
13
|
# CC_TEST_REPORTER_ID: YOUR_REPO_CC_TEST_REPORTER_ID # ENV var set in CircleCI user interface
|
|
13
14
|
steps:
|
|
14
15
|
- checkout
|
|
@@ -21,7 +22,7 @@ jobs:
|
|
|
21
22
|
&& sudo apt upgrade -q
|
|
22
23
|
- restore_cache:
|
|
23
24
|
key: v3-bundler-{{ checksum "Gemfile.lock" }}-{{ arch }}
|
|
24
|
-
- run: gem install bundler
|
|
25
|
+
- run: gem install bundler --version $BUNDLER_VERSION
|
|
25
26
|
- run: bundle config build.nokogiri --use-system-libraries
|
|
26
27
|
- run: bundle install --without staging:production --path=vendor/bundle --jobs=4 --retry=3
|
|
27
28
|
- save_cache:
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.7.2
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
nxt_vcr_harness (0.1.
|
|
4
|
+
nxt_vcr_harness (0.1.4)
|
|
5
5
|
rspec (~> 3.0)
|
|
6
|
-
vcr (~>
|
|
6
|
+
vcr (~> 6.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
11
|
coderay (1.1.2)
|
|
12
|
-
diff-lcs (1.
|
|
13
|
-
method_source (0.
|
|
14
|
-
pry (0.
|
|
15
|
-
coderay (~> 1.1
|
|
16
|
-
method_source (~>
|
|
17
|
-
rake (
|
|
18
|
-
rspec (3.
|
|
19
|
-
rspec-core (~> 3.
|
|
20
|
-
rspec-expectations (~> 3.
|
|
21
|
-
rspec-mocks (~> 3.
|
|
22
|
-
rspec-core (3.
|
|
23
|
-
rspec-support (~> 3.
|
|
24
|
-
rspec-expectations (3.
|
|
12
|
+
diff-lcs (1.4.4)
|
|
13
|
+
method_source (1.0.0)
|
|
14
|
+
pry (0.13.1)
|
|
15
|
+
coderay (~> 1.1)
|
|
16
|
+
method_source (~> 1.0)
|
|
17
|
+
rake (13.0.1)
|
|
18
|
+
rspec (3.10.0)
|
|
19
|
+
rspec-core (~> 3.10.0)
|
|
20
|
+
rspec-expectations (~> 3.10.0)
|
|
21
|
+
rspec-mocks (~> 3.10.0)
|
|
22
|
+
rspec-core (3.10.0)
|
|
23
|
+
rspec-support (~> 3.10.0)
|
|
24
|
+
rspec-expectations (3.10.0)
|
|
25
25
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
26
|
-
rspec-support (~> 3.
|
|
27
|
-
rspec-mocks (3.
|
|
26
|
+
rspec-support (~> 3.10.0)
|
|
27
|
+
rspec-mocks (3.10.0)
|
|
28
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
29
|
-
rspec-support (~> 3.
|
|
30
|
-
rspec-support (3.
|
|
29
|
+
rspec-support (~> 3.10.0)
|
|
30
|
+
rspec-support (3.10.0)
|
|
31
31
|
rspec_junit_formatter (0.4.1)
|
|
32
32
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
33
|
-
vcr (
|
|
33
|
+
vcr (6.0.0)
|
|
34
34
|
|
|
35
35
|
PLATFORMS
|
|
36
36
|
ruby
|
|
37
37
|
|
|
38
38
|
DEPENDENCIES
|
|
39
|
-
bundler (~> 1
|
|
39
|
+
bundler (~> 2.1)
|
|
40
40
|
nxt_vcr_harness!
|
|
41
41
|
pry
|
|
42
|
-
rake (~>
|
|
42
|
+
rake (~> 13.0)
|
|
43
43
|
rspec (~> 3.0)
|
|
44
44
|
rspec_junit_formatter (~> 0.4.1)
|
|
45
45
|
|
|
46
46
|
BUNDLED WITH
|
|
47
|
-
1.
|
|
47
|
+
2.1.4
|
data/README.md
CHANGED
|
@@ -23,8 +23,9 @@ Or install it yourself as:
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
NxtVcrHarness currently has two features. You can use it to find vcr cassettes that are not being used when you
|
|
26
|
-
run your test suite. Enable it by calling `NxtVcrHarness.
|
|
27
|
-
|
|
26
|
+
run your test suite. Enable it by calling `NxtVcrHarness.track_cassettes_if(...your condition in here...)`.
|
|
27
|
+
Note that the output only makes sense when you run your complete test suite.
|
|
28
|
+
If you run only a subset all cassettes that are used by your other test will be included too.
|
|
28
29
|
|
|
29
30
|
The second feature is that you can enable your custom :vcr tag by calling `NxtVcrHarness.enable_vcr_tag`. This will
|
|
30
31
|
automatically name your vcr cassettes based on the your rspec example and the surrounding contexts. You can also
|
data/lib/nxt_vcr_harness.rb
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
require "nxt_vcr_harness/version"
|
|
2
2
|
require 'nxt_vcr_harness/cassette_name_by_example'
|
|
3
3
|
require 'nxt_vcr_harness/cassette_tracker'
|
|
4
|
+
require 'digest'
|
|
4
5
|
|
|
5
6
|
module NxtVcrHarness
|
|
6
7
|
module VcrCassetteHelper
|
|
7
8
|
def with_vcr_cassette(example, **options, &block)
|
|
8
9
|
cassette_by_example_options = %i[prefix suffix]
|
|
9
|
-
cassette_path = CassetteNameByExample.new(example).call(options.slice(*cassette_by_example_options))
|
|
10
|
+
cassette_path = CassetteNameByExample.new(example).call(**options.slice(*cassette_by_example_options))
|
|
10
11
|
|
|
11
12
|
vcr_options = options.reject { |k,_| k.in?(cassette_by_example_options) }
|
|
12
13
|
|
|
@@ -17,7 +18,7 @@ module NxtVcrHarness
|
|
|
17
18
|
|
|
18
19
|
def hash_from_example(example, **options)
|
|
19
20
|
cassette_by_example_options = %i[prefix suffix]
|
|
20
|
-
name = CassetteNameByExample.new(example).call(options.slice(*cassette_by_example_options))
|
|
21
|
+
name = CassetteNameByExample.new(example).call(**options.slice(*cassette_by_example_options))
|
|
21
22
|
Digest::MD5.hexdigest(name)
|
|
22
23
|
end
|
|
23
24
|
end
|
|
@@ -28,7 +29,7 @@ module NxtVcrHarness
|
|
|
28
29
|
|
|
29
30
|
RSpec.configure do |config|
|
|
30
31
|
config.around(:each, tag_name) do |example|
|
|
31
|
-
cassette_path = CassetteNameByExample.new(example).call(options.slice(:prefix, :suffix))
|
|
32
|
+
cassette_path = CassetteNameByExample.new(example).call(**options.slice(:prefix, :suffix))
|
|
32
33
|
cassette_options = example.metadata[tag_name].is_a?(TrueClass) ? {} : example.metadata[tag_name]
|
|
33
34
|
cassette_options = default_cassette_options.merge(cassette_options)
|
|
34
35
|
|
data/nxt_vcr_harness.gemspec
CHANGED
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
23
23
|
spec.metadata["source_code_uri"] = "https://github.com/nxt-insurance/nxt_vcr_harness"
|
|
24
|
+
spec.metadata["changelog_uri"] = "https://github.com/nxt-insurance/nxt_vcr_harness/CHANGELOG.md"
|
|
24
25
|
else
|
|
25
26
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
26
27
|
"public gem pushes."
|
|
@@ -36,10 +37,10 @@ Gem::Specification.new do |spec|
|
|
|
36
37
|
spec.require_paths = ["lib"]
|
|
37
38
|
|
|
38
39
|
spec.add_dependency "rspec", "~> 3.0"
|
|
39
|
-
spec.add_dependency "vcr", "~>
|
|
40
|
+
spec.add_dependency "vcr", "~> 6.0"
|
|
40
41
|
|
|
41
|
-
spec.add_development_dependency "bundler", "~> 1
|
|
42
|
-
spec.add_development_dependency "rake", "~>
|
|
42
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
|
43
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
43
44
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
44
45
|
spec.add_development_dependency "pry"
|
|
45
46
|
spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nxt_vcr_harness
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andreas Robecke
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2020-12-04 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rspec
|
|
@@ -32,42 +32,42 @@ dependencies:
|
|
|
32
32
|
requirements:
|
|
33
33
|
- - "~>"
|
|
34
34
|
- !ruby/object:Gem::Version
|
|
35
|
-
version: '
|
|
35
|
+
version: '6.0'
|
|
36
36
|
type: :runtime
|
|
37
37
|
prerelease: false
|
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
39
39
|
requirements:
|
|
40
40
|
- - "~>"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '
|
|
42
|
+
version: '6.0'
|
|
43
43
|
- !ruby/object:Gem::Dependency
|
|
44
44
|
name: bundler
|
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
|
46
46
|
requirements:
|
|
47
47
|
- - "~>"
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '1
|
|
49
|
+
version: '2.1'
|
|
50
50
|
type: :development
|
|
51
51
|
prerelease: false
|
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
|
54
54
|
- - "~>"
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '1
|
|
56
|
+
version: '2.1'
|
|
57
57
|
- !ruby/object:Gem::Dependency
|
|
58
58
|
name: rake
|
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
|
61
61
|
- - "~>"
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '
|
|
63
|
+
version: '13.0'
|
|
64
64
|
type: :development
|
|
65
65
|
prerelease: false
|
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
|
67
67
|
requirements:
|
|
68
68
|
- - "~>"
|
|
69
69
|
- !ruby/object:Gem::Version
|
|
70
|
-
version: '
|
|
70
|
+
version: '13.0'
|
|
71
71
|
- !ruby/object:Gem::Dependency
|
|
72
72
|
name: rspec
|
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -123,6 +123,7 @@ files:
|
|
|
123
123
|
- ".rspec"
|
|
124
124
|
- ".ruby-version"
|
|
125
125
|
- ".travis.yml"
|
|
126
|
+
- CHANGELOG.md
|
|
126
127
|
- Gemfile
|
|
127
128
|
- Gemfile.lock
|
|
128
129
|
- LICENSE.txt
|
|
@@ -142,6 +143,7 @@ metadata:
|
|
|
142
143
|
allowed_push_host: https://rubygems.org
|
|
143
144
|
homepage_uri: https://github.com/nxt-insurance
|
|
144
145
|
source_code_uri: https://github.com/nxt-insurance/nxt_vcr_harness
|
|
146
|
+
changelog_uri: https://github.com/nxt-insurance/nxt_vcr_harness/CHANGELOG.md
|
|
145
147
|
post_install_message:
|
|
146
148
|
rdoc_options: []
|
|
147
149
|
require_paths:
|
|
@@ -157,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
157
159
|
- !ruby/object:Gem::Version
|
|
158
160
|
version: '0'
|
|
159
161
|
requirements: []
|
|
160
|
-
rubygems_version: 3.
|
|
162
|
+
rubygems_version: 3.1.4
|
|
161
163
|
signing_key:
|
|
162
164
|
specification_version: 4
|
|
163
165
|
summary: Intuitive VCR cassette naming
|