rspec-snapshot 0.1.0 → 2.0.1
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 +5 -5
- data/.rubocop.yml +89 -0
- data/.ruby-version +1 -0
- data/.travis.yml +6 -3
- data/LICENSE.md +19 -0
- data/README.md +119 -24
- data/lib/rspec/snapshot/configuration.rb +10 -4
- data/lib/rspec/snapshot/default_serializer.rb +15 -0
- data/lib/rspec/snapshot/matchers/match_snapshot.rb +89 -25
- data/lib/rspec/snapshot/matchers.rb +11 -4
- data/lib/rspec/snapshot/version.rb +3 -1
- data/lib/rspec/snapshot.rb +6 -4
- data/rspec-snapshot.gemspec +26 -16
- metadata +82 -23
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '099c9c3b45ca0936bb35a90dc10263dc0634cfbf307e32eab60eb6154cd0d94c'
|
4
|
+
data.tar.gz: 862c34e9f5693afe80ca9384048d03d67e78a6e09300b1906a1e8c929315b263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a25332c1f83a33d982f16fdf31284d68800db12c1f49a08320e3eca1515a614bd7ba1cb0a5028953d8d32c0cade632c8970a86d1c9fdf941c9b41c9d71476c55
|
7
|
+
data.tar.gz: 3c952f9f7da76ac1c464a9e35c69e8b280e09aa6066c9e763eba97e4ad7b4ded481516b68bdbecf35d235010a51e832a15955538e56d02d355c84299c4e42409
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rspec
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
NewCops: "enable"
|
6
|
+
Exclude:
|
7
|
+
- "Gemfile"
|
8
|
+
- "Rakefile"
|
9
|
+
- "bin/**/*"
|
10
|
+
- "spec/fixtures/**/*"
|
11
|
+
TargetRubyVersion: 2.5
|
12
|
+
|
13
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
14
|
+
Enabled: true
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 80
|
17
|
+
Layout/SpaceAroundMethodCallOperator:
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Lint:
|
21
|
+
Severity: error
|
22
|
+
Lint/DeprecatedOpenSSLConstant:
|
23
|
+
Enabled: true
|
24
|
+
Lint/RaiseException:
|
25
|
+
Enabled: true
|
26
|
+
Lint/StructNewOverride:
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Metrics/BlockLength:
|
30
|
+
Exclude:
|
31
|
+
- "rspec-snapshot.gemspec"
|
32
|
+
- "spec/**/*"
|
33
|
+
|
34
|
+
RSpec/AnyInstance:
|
35
|
+
Enabled: true
|
36
|
+
RSpec/ContextWording:
|
37
|
+
Prefixes:
|
38
|
+
- when
|
39
|
+
- with
|
40
|
+
- without
|
41
|
+
- and
|
42
|
+
RSpec/ExampleLength:
|
43
|
+
Enabled: true
|
44
|
+
Max: 10
|
45
|
+
RSpec/ExpectInHook:
|
46
|
+
Enabled: true
|
47
|
+
RSpec/FilePath:
|
48
|
+
Enabled: true
|
49
|
+
RSpec/InstanceVariable:
|
50
|
+
Enabled: false
|
51
|
+
RSpec/LeakyConstantDeclaration:
|
52
|
+
Enabled: true
|
53
|
+
RSpec/LetSetup:
|
54
|
+
Enabled: true
|
55
|
+
RSpec/MessageSpies:
|
56
|
+
Enabled: true
|
57
|
+
RSpec/MultipleExpectations:
|
58
|
+
Enabled: true
|
59
|
+
RSpec/MultipleMemoizedHelpers:
|
60
|
+
Enabled: false
|
61
|
+
RSpec/NamedSubject:
|
62
|
+
Enabled: false # Disabled for preference
|
63
|
+
RSpec/NestedGroups:
|
64
|
+
Max: 6
|
65
|
+
RSpec/ScatteredSetup:
|
66
|
+
Enabled: true
|
67
|
+
RSpec/SubjectStub:
|
68
|
+
Enabled: true
|
69
|
+
RSpec/VerifiedDoubles:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Style/AccessModifierDeclarations:
|
73
|
+
Enabled: false # Disabled since we follow Clean Code's newspaper code structure
|
74
|
+
Style/DoubleNegation:
|
75
|
+
Enabled: true
|
76
|
+
Style/ExponentialNotation:
|
77
|
+
Enabled: true
|
78
|
+
Style/HashEachMethods:
|
79
|
+
Enabled: true
|
80
|
+
Style/HashTransformKeys:
|
81
|
+
Enabled: true
|
82
|
+
Style/HashTransformValues:
|
83
|
+
Enabled: true
|
84
|
+
Style/LineEndConcatenation:
|
85
|
+
Enabled: false
|
86
|
+
Style/MultilineTernaryOperator:
|
87
|
+
Enabled: false # Disabled due to preference
|
88
|
+
Style/SlicingWithRange:
|
89
|
+
Enabled: true
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/.travis.yml
CHANGED
data/LICENSE.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2016 Wei Zhu
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
14
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
15
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
16
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
17
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
18
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
19
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# RSpec::Snapshot
|
1
|
+
# RSpec::Snapshot [](https://travis-ci.com/levinmr/rspec-snapshot)
|
2
2
|
|
3
|
-
|
3
|
+
Adds snapshot testing to RSpec, inspired by [Jest](https://jestjs.io/).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,7 +12,7 @@ gem 'rspec-snapshot'
|
|
12
12
|
|
13
13
|
And then execute:
|
14
14
|
|
15
|
-
$ bundle
|
15
|
+
$ bundle install
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
@@ -20,24 +20,35 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
The gem provides `match_snapshot` and `snapshot` RSpec matchers which take
|
24
|
+
a snapshot name as an argument like:
|
24
25
|
|
25
26
|
```ruby
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
# match_snapshot
|
28
|
+
expect(generated_email).to match_snapshot('welcome_email')
|
29
|
+
|
30
|
+
# match argument with snapshot
|
31
|
+
expect(logger).to have_received(:info).with(snapshot('log message'))
|
31
32
|
```
|
32
33
|
|
33
|
-
|
34
|
+
When a test is run using a snapshot matcher and a snapshot file does not exist
|
35
|
+
matching the passed name, the test value encountered will be serialized and
|
36
|
+
stored in your snapshot directory as the file: `#{snapshot_name}.snap`
|
37
|
+
|
38
|
+
When a test is run using a snapshot matcher and a snapshot file exists matching
|
39
|
+
the passed name, then the test value encountered will be serialized and
|
40
|
+
compared to the snapshot file contents. If the values match your test passes,
|
41
|
+
otherwise it fails.
|
42
|
+
|
43
|
+
### Rails request testing
|
34
44
|
|
35
45
|
```ruby
|
36
|
-
describe
|
37
|
-
describe
|
38
|
-
it
|
39
|
-
get
|
40
|
-
|
46
|
+
RSpec.describe 'Posts', type: :request do
|
47
|
+
describe 'GET /posts' do
|
48
|
+
it 'returns a list of post' do
|
49
|
+
get posts_path
|
50
|
+
|
51
|
+
expect(response.body).to match_snapshot('get_posts')
|
41
52
|
end
|
42
53
|
end
|
43
54
|
end
|
@@ -46,28 +57,112 @@ end
|
|
46
57
|
### Rails view testing
|
47
58
|
|
48
59
|
```ruby
|
49
|
-
describe
|
50
|
-
it
|
60
|
+
RSpec.describe 'widgets/index', type: :view do
|
61
|
+
it 'displays all the widgets' do
|
51
62
|
assign(:widgets, [
|
52
|
-
Widget.create!(:name =>
|
53
|
-
Widget.create!(:name =>
|
63
|
+
Widget.create!(:name => 'slicer'),
|
64
|
+
Widget.create!(:name => 'dicer')
|
54
65
|
])
|
55
66
|
|
56
67
|
render
|
57
68
|
|
58
|
-
expect(rendered).to match_snapshot('
|
69
|
+
expect(rendered).to match_snapshot('widgets/index')
|
59
70
|
end
|
60
71
|
end
|
61
72
|
```
|
62
73
|
|
63
|
-
|
74
|
+
### UPDATE_SNAPSHOTS environment variable
|
75
|
+
|
76
|
+
Occasionally you may want to regenerate all encountered snapshots for a set of
|
77
|
+
tests. To do this, just set the UPDATE_SNAPSHOTS environment variable for your
|
78
|
+
test command.
|
79
|
+
|
80
|
+
Update all snapshots
|
81
|
+
|
82
|
+
$ UPDATE_SNAPSHOTS=true bundle exec rspec
|
83
|
+
|
84
|
+
Update snapshots for some subset of tests
|
85
|
+
|
86
|
+
$ UPDATE_SNAPSHOTS=true bundle exec rspec spec/foo/bar
|
87
|
+
|
88
|
+
## Configuration
|
89
|
+
|
90
|
+
Global configurations for rspec-snapshot are optional. Details below:
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
RSpec.configure do |config|
|
94
|
+
# The default setting is `:relative`, which means snapshot files will be
|
95
|
+
# created in a '__snapshots__' directory adjacent to the spec file where the
|
96
|
+
# matcher is used.
|
97
|
+
#
|
98
|
+
# Set this value to put all snapshots in a fixed directory
|
99
|
+
config.snapshot_dir = "spec/fixtures/snapshots"
|
100
|
+
|
101
|
+
# Defaults to using the awesome_print gem to serialize values for snapshots
|
102
|
+
#
|
103
|
+
# Set this value to use a custom snapshot serializer
|
104
|
+
config.snapshot_serializer = MyFavoriteSerializer
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
### Custom serializers
|
109
|
+
|
110
|
+
By default, values to be stored as snapshots are serialized to human readable
|
111
|
+
string form using the [awesome_print](https://github.com/awesome-print/awesome_print) gem.
|
112
|
+
|
113
|
+
You can pass custom serializers to `rspec-snapshot` if you prefer. Pass a serializer class name to the global RSpec config, or to an individual
|
114
|
+
matcher as a config option:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
# Set a custom serializer for all tests
|
118
|
+
RSpec.configure do |config|
|
119
|
+
config.snapshot_serializer = MyCoolGeneralSerializer
|
120
|
+
end
|
121
|
+
|
122
|
+
# Set a custom serializer for this specific test
|
123
|
+
expect(html_response).to(
|
124
|
+
match_snapshot('html_response', { snapshot_serializer: MyAwesomeHTMLSerializer })
|
125
|
+
)
|
126
|
+
```
|
127
|
+
|
128
|
+
Serializer classes are required to have one instance method `dump` which takes
|
129
|
+
the value to be serialized and returns a string.
|
130
|
+
|
131
|
+
## Migration
|
132
|
+
|
133
|
+
If you're updating to version 2.x.x from 1.x.x, you may need to update all your existing snapshots since the serialization method has changed.
|
134
|
+
|
135
|
+
$ UPDATE_SNAPSHOTS=true bundle exec rspec
|
64
136
|
|
65
137
|
## Development
|
66
138
|
|
67
|
-
|
139
|
+
### Initial Setup
|
140
|
+
|
141
|
+
Install a current version of ruby (> 2.5) and bundler. Then install gems
|
142
|
+
|
143
|
+
$ bundle install
|
144
|
+
|
145
|
+
### Linting
|
146
|
+
|
147
|
+
$ bundle exec rubocop
|
148
|
+
|
149
|
+
### Unit tests
|
68
150
|
|
69
|
-
|
151
|
+
$ bundle exec rspec
|
152
|
+
|
153
|
+
### Interactive console with the gem code loaded
|
154
|
+
|
155
|
+
$ bin/console
|
156
|
+
|
157
|
+
### Rake commands
|
158
|
+
|
159
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
160
|
+
release a new version, update the version number in `version.rb`, and then run
|
161
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
162
|
+
git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
70
163
|
|
71
164
|
## Contributing
|
72
165
|
|
73
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
166
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/levinmr/rspec-snapshot.
|
167
|
+
|
168
|
+
A big thanks to the original author [@yesmeck](https://github.com/yesmeck).
|
@@ -1,11 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RSpec
|
4
|
+
# rubocop:disable Style/Documentation
|
2
5
|
module Snapshot
|
3
|
-
class Configuration
|
6
|
+
class Configuration
|
7
|
+
def self.initialize_configuration(config)
|
8
|
+
config.add_setting :snapshot_dir, default: :relative
|
4
9
|
|
5
|
-
|
6
|
-
|
10
|
+
config.add_setting :snapshot_serializer, default: nil
|
11
|
+
end
|
7
12
|
end
|
8
13
|
|
9
|
-
initialize_configuration RSpec.configuration
|
14
|
+
Configuration.initialize_configuration RSpec.configuration
|
10
15
|
end
|
16
|
+
# rubocop:enable Style/Documentation
|
11
17
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'awesome_print'
|
4
|
+
|
5
|
+
module RSpec
|
6
|
+
module Snapshot
|
7
|
+
# Serializes values in a human readable way for snapshots using the
|
8
|
+
# awesome_print gem
|
9
|
+
class DefaultSerializer
|
10
|
+
def dump(value)
|
11
|
+
value.ai(plain: true, indent: 2)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,45 +1,109 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'rspec/snapshot/default_serializer'
|
2
5
|
|
3
6
|
module RSpec
|
4
7
|
module Snapshot
|
5
8
|
module Matchers
|
6
|
-
|
7
|
-
|
9
|
+
# RSpec matcher for snapshot testing
|
10
|
+
class MatchSnapshot
|
11
|
+
attr_reader :actual, :expected
|
12
|
+
|
13
|
+
def initialize(metadata, snapshot_name, config)
|
8
14
|
@metadata = metadata
|
9
15
|
@snapshot_name = snapshot_name
|
16
|
+
@config = config
|
17
|
+
@serializer = serializer_class.new
|
18
|
+
@snapshot_path = File.join(snapshot_dir, "#{@snapshot_name}.snap")
|
19
|
+
create_snapshot_dir
|
10
20
|
end
|
11
21
|
|
12
|
-
def
|
13
|
-
@
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
if File.exist?(snap_path)
|
18
|
-
file = File.new(snap_path)
|
19
|
-
@expect = file.read
|
20
|
-
file.close
|
21
|
-
@actual == @expect
|
22
|
+
private def serializer_class
|
23
|
+
if @config[:snapshot_serializer]
|
24
|
+
@config[:snapshot_serializer]
|
25
|
+
elsif RSpec.configuration.snapshot_serializer
|
26
|
+
RSpec.configuration.snapshot_serializer
|
22
27
|
else
|
23
|
-
|
24
|
-
file = File.new(snap_path, "w+")
|
25
|
-
file.write(@actual)
|
26
|
-
file.close
|
27
|
-
true
|
28
|
+
DefaultSerializer
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
-
def failure_message
|
33
|
-
"\nexpected: #{@expect_snap}\n got: #{@actual_snap}\n"
|
34
|
-
end
|
35
|
-
|
36
|
-
def snapshot_dir
|
32
|
+
private def snapshot_dir
|
37
33
|
if RSpec.configuration.snapshot_dir.to_s == 'relative'
|
38
|
-
File.dirname(@metadata[:file_path]) <<
|
34
|
+
File.dirname(@metadata[:file_path]) << '/__snapshots__'
|
39
35
|
else
|
40
36
|
RSpec.configuration.snapshot_dir
|
41
37
|
end
|
42
38
|
end
|
39
|
+
|
40
|
+
private def create_snapshot_dir
|
41
|
+
return if Dir.exist?(File.dirname(@snapshot_path))
|
42
|
+
|
43
|
+
FileUtils.mkdir_p(File.dirname(@snapshot_path))
|
44
|
+
end
|
45
|
+
|
46
|
+
def matches?(actual)
|
47
|
+
@actual = serialize(actual)
|
48
|
+
|
49
|
+
write_snapshot
|
50
|
+
|
51
|
+
@expected = read_snapshot
|
52
|
+
|
53
|
+
@actual == @expected
|
54
|
+
end
|
55
|
+
|
56
|
+
# === is the method called when matching an argument
|
57
|
+
alias === matches?
|
58
|
+
alias match matches?
|
59
|
+
|
60
|
+
private def serialize(value)
|
61
|
+
return value if value.is_a?(String)
|
62
|
+
|
63
|
+
@serializer.dump(value)
|
64
|
+
end
|
65
|
+
|
66
|
+
private def write_snapshot
|
67
|
+
return unless should_write?
|
68
|
+
|
69
|
+
RSpec.configuration.reporter.message(
|
70
|
+
"Snapshot written: #{@snapshot_path}"
|
71
|
+
)
|
72
|
+
file = File.new(@snapshot_path, 'w+')
|
73
|
+
file.write(@actual)
|
74
|
+
file.close
|
75
|
+
end
|
76
|
+
|
77
|
+
private def should_write?
|
78
|
+
update_snapshots? || !File.exist?(@snapshot_path)
|
79
|
+
end
|
80
|
+
|
81
|
+
private def update_snapshots?
|
82
|
+
ENV['UPDATE_SNAPSHOTS']
|
83
|
+
end
|
84
|
+
|
85
|
+
private def read_snapshot
|
86
|
+
file = File.new(@snapshot_path)
|
87
|
+
value = file.read
|
88
|
+
file.close
|
89
|
+
value
|
90
|
+
end
|
91
|
+
|
92
|
+
def description
|
93
|
+
"to match a snapshot containing: \"#{@expected}\""
|
94
|
+
end
|
95
|
+
|
96
|
+
def diffable?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
def failure_message
|
101
|
+
"\nexpected: #{@expected}\n got: #{@actual}\n"
|
102
|
+
end
|
103
|
+
|
104
|
+
def failure_message_when_negated
|
105
|
+
"\nexpected: #{@expected} not to match #{@actual}\n"
|
106
|
+
end
|
43
107
|
end
|
44
108
|
end
|
45
109
|
end
|
@@ -1,13 +1,20 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rspec/snapshot/matchers/match_snapshot'
|
3
4
|
|
4
5
|
module RSpec
|
5
6
|
module Snapshot
|
7
|
+
# rubocop:disable Style/Documentation
|
6
8
|
module Matchers
|
7
|
-
def match_snapshot(snapshot_name)
|
8
|
-
|
9
|
+
def match_snapshot(snapshot_name, config = {})
|
10
|
+
MatchSnapshot.new(RSpec.current_example.metadata,
|
11
|
+
snapshot_name,
|
12
|
+
config)
|
9
13
|
end
|
14
|
+
|
15
|
+
alias snapshot match_snapshot
|
10
16
|
end
|
17
|
+
# rubocop:enable Style/Documentation
|
11
18
|
end
|
12
19
|
end
|
13
20
|
|
data/lib/rspec/snapshot.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rspec'
|
4
|
+
require 'rspec/snapshot/version'
|
5
|
+
require 'rspec/snapshot/configuration'
|
6
|
+
require 'rspec/snapshot/matchers'
|
data/rspec-snapshot.gemspec
CHANGED
@@ -1,27 +1,37 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'rspec/snapshot/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'rspec-snapshot'
|
8
9
|
spec.version = RSpec::Snapshot::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
10
|
+
spec.authors = ['Mike Levin']
|
11
|
+
spec.email = ['michael_r_levin@yahoo.com']
|
12
|
+
spec.license = 'MIT'
|
11
13
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
14
|
+
spec.summary = 'RSpec Snapshot Matcher'
|
15
|
+
spec.description = 'Adding snapshot testing to RSpec'
|
16
|
+
spec.homepage = 'https://github.com/levinmr/rspec-snapshot'
|
15
17
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject
|
17
|
-
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
18
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
-
spec.require_paths = [
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.required_ruby_version = '>= 2.5.0'
|
20
26
|
|
21
|
-
spec.add_dependency
|
27
|
+
spec.add_dependency 'awesome_print', '> 1.0.0'
|
28
|
+
spec.add_dependency 'rspec', '> 3.0.0'
|
22
29
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.2'
|
31
|
+
spec.add_development_dependency 'byebug'
|
32
|
+
spec.add_development_dependency 'pry-byebug'
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 1.22'
|
35
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
|
36
|
+
spec.add_development_dependency 'simplecov'
|
27
37
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Mike Levin
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: awesome_print
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rspec
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,81 +44,127 @@ dependencies:
|
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
47
|
+
version: '2.2'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
54
|
+
version: '2.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: rake
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
44
86
|
requirements:
|
45
87
|
- - "~>"
|
46
88
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
89
|
+
version: '13.0'
|
48
90
|
type: :development
|
49
91
|
prerelease: false
|
50
92
|
version_requirements: !ruby/object:Gem::Requirement
|
51
93
|
requirements:
|
52
94
|
- - "~>"
|
53
95
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
96
|
+
version: '13.0'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
98
|
+
name: rubocop
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
101
|
- - "~>"
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
103
|
+
version: '1.22'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
110
|
+
version: '1.22'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
112
|
+
name: rubocop-rspec
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - "~>"
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: 5
|
117
|
+
version: '2.5'
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
122
|
- - "~>"
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: 5
|
124
|
+
version: '2.5'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
83
139
|
description: Adding snapshot testing to RSpec
|
84
140
|
email:
|
85
|
-
-
|
141
|
+
- michael_r_levin@yahoo.com
|
86
142
|
executables: []
|
87
143
|
extensions: []
|
88
144
|
extra_rdoc_files: []
|
89
145
|
files:
|
90
146
|
- ".gitignore"
|
91
147
|
- ".rspec"
|
148
|
+
- ".rubocop.yml"
|
149
|
+
- ".ruby-version"
|
92
150
|
- ".travis.yml"
|
93
151
|
- Gemfile
|
152
|
+
- LICENSE.md
|
94
153
|
- README.md
|
95
154
|
- Rakefile
|
96
155
|
- bin/console
|
97
|
-
- bin/setup
|
98
156
|
- lib/rspec/snapshot.rb
|
99
157
|
- lib/rspec/snapshot/configuration.rb
|
158
|
+
- lib/rspec/snapshot/default_serializer.rb
|
100
159
|
- lib/rspec/snapshot/matchers.rb
|
101
160
|
- lib/rspec/snapshot/matchers/match_snapshot.rb
|
102
161
|
- lib/rspec/snapshot/version.rb
|
103
162
|
- rspec-snapshot.gemspec
|
104
|
-
homepage: https://github.com/
|
105
|
-
licenses:
|
163
|
+
homepage: https://github.com/levinmr/rspec-snapshot
|
164
|
+
licenses:
|
165
|
+
- MIT
|
106
166
|
metadata: {}
|
107
|
-
post_install_message:
|
167
|
+
post_install_message:
|
108
168
|
rdoc_options: []
|
109
169
|
require_paths:
|
110
170
|
- lib
|
@@ -112,16 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
172
|
requirements:
|
113
173
|
- - ">="
|
114
174
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
175
|
+
version: 2.5.0
|
116
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
177
|
requirements:
|
118
178
|
- - ">="
|
119
179
|
- !ruby/object:Gem::Version
|
120
180
|
version: '0'
|
121
181
|
requirements: []
|
122
|
-
|
123
|
-
|
124
|
-
signing_key:
|
182
|
+
rubygems_version: 3.1.6
|
183
|
+
signing_key:
|
125
184
|
specification_version: 4
|
126
185
|
summary: RSpec Snapshot Matcher
|
127
186
|
test_files: []
|