rspec-snapshot 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
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/.travis.yml
CHANGED
@@ -3,17 +3,15 @@
|
|
3
3
|
module RSpec
|
4
4
|
# rubocop:disable Style/Documentation
|
5
5
|
module Snapshot
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
class Configuration
|
7
|
+
def self.initialize_configuration(config)
|
8
|
+
config.add_setting :snapshot_dir, default: :relative
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
config.add_setting :snapshot_serializer, default: nil
|
10
|
+
config.add_setting :snapshot_serializer, default: nil
|
11
|
+
end
|
14
12
|
end
|
15
13
|
|
16
|
-
initialize_configuration RSpec.configuration
|
14
|
+
Configuration.initialize_configuration RSpec.configuration
|
17
15
|
end
|
18
16
|
# rubocop:enable Style/Documentation
|
19
17
|
end
|
@@ -7,7 +7,7 @@ module RSpec
|
|
7
7
|
module Snapshot
|
8
8
|
module Matchers
|
9
9
|
# RSpec matcher for snapshot testing
|
10
|
-
class
|
10
|
+
class MatchSnapshot
|
11
11
|
attr_reader :actual, :expected
|
12
12
|
|
13
13
|
def initialize(metadata, snapshot_name, config)
|
@@ -55,13 +55,12 @@ module RSpec
|
|
55
55
|
|
56
56
|
# === is the method called when matching an argument
|
57
57
|
alias === matches?
|
58
|
+
alias match matches?
|
58
59
|
|
59
60
|
private def serialize(value)
|
60
|
-
if value.is_a?(String)
|
61
|
-
|
62
|
-
|
63
|
-
@serializer.dump(value)
|
64
|
-
end
|
61
|
+
return value if value.is_a?(String)
|
62
|
+
|
63
|
+
@serializer.dump(value)
|
65
64
|
end
|
66
65
|
|
67
66
|
private def write_snapshot
|
@@ -90,6 +89,10 @@ module RSpec
|
|
90
89
|
value
|
91
90
|
end
|
92
91
|
|
92
|
+
def description
|
93
|
+
"to match a snapshot containing: \"#{@expected}\""
|
94
|
+
end
|
95
|
+
|
93
96
|
def diffable?
|
94
97
|
true
|
95
98
|
end
|
data/rspec-snapshot.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'byebug'
|
32
32
|
spec.add_development_dependency 'pry-byebug'
|
33
33
|
spec.add_development_dependency 'rake', '~> 13.0'
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
35
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.
|
34
|
+
spec.add_development_dependency 'rubocop', '~> 1.22'
|
35
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
|
36
36
|
spec.add_development_dependency 'simplecov'
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Levin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.22'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.22'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rubocop-rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '2.
|
117
|
+
version: '2.5'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '2.
|
124
|
+
version: '2.5'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|