rspec-snapshot 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9e969397a7cd054e4bd77820f0e91574d45556659fcded20178ca52f8bc077d
4
- data.tar.gz: ca056e2c01e588a69aa51bb86b88af081acff4abd580cf74b1b624f4e3d55822
3
+ metadata.gz: '099c9c3b45ca0936bb35a90dc10263dc0634cfbf307e32eab60eb6154cd0d94c'
4
+ data.tar.gz: 862c34e9f5693afe80ca9384048d03d67e78a6e09300b1906a1e8c929315b263
5
5
  SHA512:
6
- metadata.gz: 5e7415a66e8182852a55ac99d922bb03488114cc0c3cf97f56c49ea11ff419f2a53dfbb67bd6aa3cd5956a9f533d3a4c8933897e651a6dc5578296366be2df43
7
- data.tar.gz: 69d2418bbfd2c94096ce3aae0dcb6a3415d8c217d491ddd502aa5324e0dd6a799ce595cfa9b846c9a2c474679301ac2ab3c2bd49d41010f39c5fa14c4d55aa2a
6
+ metadata.gz: a25332c1f83a33d982f16fdf31284d68800db12c1f49a08320e3eca1515a614bd7ba1cb0a5028953d8d32c0cade632c8970a86d1c9fdf941c9b41c9d71476c55
7
+ data.tar.gz: 3c952f9f7da76ac1c464a9e35c69e8b280e09aa6066c9e763eba97e4ad7b4ded481516b68bdbecf35d235010a51e832a15955538e56d02d355c84299c4e42409
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
+ dist: focal
3
4
  rvm:
4
5
  - 2.5.9
5
- - 2.6.7
6
- - 2.7.3
7
- before_install: gem install bundler:2.2.20
6
+ - 2.6.8
7
+ - 2.7.4
8
+ - 3.0.2
9
+ before_install: gem install bundler:2.2.22
@@ -3,17 +3,15 @@
3
3
  module RSpec
4
4
  # rubocop:disable Style/Documentation
5
5
  module Snapshot
6
- # rubocop:disable Lint/EmptyClass
7
- class Configuration; end
8
- # rubocop:enable Lint/EmptyClass
6
+ class Configuration
7
+ def self.initialize_configuration(config)
8
+ config.add_setting :snapshot_dir, default: :relative
9
9
 
10
- def self.initialize_configuration(config)
11
- config.add_setting :snapshot_dir, default: :relative
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 MatchSnapShot
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
- value
62
- else
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
@@ -7,7 +7,7 @@ module RSpec
7
7
  # rubocop:disable Style/Documentation
8
8
  module Matchers
9
9
  def match_snapshot(snapshot_name, config = {})
10
- MatchSnapShot.new(RSpec.current_example.metadata,
10
+ MatchSnapshot.new(RSpec.current_example.metadata,
11
11
  snapshot_name,
12
12
  config)
13
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Snapshot
5
- VERSION = '2.0.0'
5
+ VERSION = '2.0.1'
6
6
  end
7
7
  end
@@ -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.17'
35
- spec.add_development_dependency 'rubocop-rspec', '~> 2.4'
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.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-06-22 00:00:00.000000000 Z
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.17'
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.17'
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.4'
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.4'
124
+ version: '2.5'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement