rematch 2.0.0 → 3.0.0
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/lib/minitest/rematch_plugin.rb +5 -1
- data/lib/rematch.rb +4 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1c8f28666e75297ba7dfa84ba0432715976075f2a2e1699b145eea7f41789fc
|
4
|
+
data.tar.gz: 39c024389c8ccdfd97627952719c2cd0004a69f906b50621e1a9ab9b230e2947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20cce9b1ae1ee171648d98f8838370bf913100c6dd0d9ccb92af0bbfcd6c0d41a49471e18e78b4235c06151ab8500a23c5a15293b583cc2e141ea035ba8af11b
|
7
|
+
data.tar.gz: dc681036308b31d4d08efe48813c3ffa0a5d8d71d326b6a2495df2ac4f3c00c295a1a45b288046b10d2d8b2069756e150d57f1ab904b247cbc606faae27d216b
|
@@ -27,7 +27,11 @@ module Minitest
|
|
27
27
|
assertion = :assert_equal
|
28
28
|
message = nil
|
29
29
|
args.each { |arg| arg.is_a?(Symbol) ? assertion = arg : message = arg }
|
30
|
-
|
30
|
+
if actual.nil? # use specific assert_nil after deprecation of assert_equal nil
|
31
|
+
assert_nil @rematch.rematch(key, actual), message
|
32
|
+
else
|
33
|
+
send assertion, @rematch.rematch(key, actual), actual, message # assert that the stored value is the same actual value
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
# Temporarily used to store the actual value, useful for reconciliation of expected changed values
|
data/lib/rematch.rb
CHANGED
@@ -5,8 +5,8 @@ require 'fileutils'
|
|
5
5
|
|
6
6
|
# Handles the key/value store for each test
|
7
7
|
class Rematch
|
8
|
-
VERSION = '
|
9
|
-
|
8
|
+
VERSION = '3.0.0'
|
9
|
+
DEFAULT = { ext: '.yaml' } # rubocop:disable Style/MutableConstant
|
10
10
|
|
11
11
|
@rebuild = false # rebuild the store?
|
12
12
|
@rebuilt = [] # paths already rebuilt
|
@@ -25,10 +25,10 @@ class Rematch
|
|
25
25
|
|
26
26
|
# Instantiated at each test, stores the path and the unique id of the test being run
|
27
27
|
def initialize(path:, id:)
|
28
|
-
path = "#{path}#{
|
28
|
+
path = "#{path}#{DEFAULT[:ext]}"
|
29
29
|
self.class.check_rebuild(path)
|
30
30
|
@store = YAML::Store.new(path, true)
|
31
|
-
@id = id
|
31
|
+
@id = id.tr('#: ', '_') # easier key string for clumsy yaml parsers/highlighters
|
32
32
|
end
|
33
33
|
|
34
34
|
# Retrieve the stored value for the current assertion if its key is known; store the value otherwise
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rematch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Instead of copying and pasting large outputs or big ruby structures into
|
14
14
|
all the affected test files every time your code change, you can do it the easy
|
@@ -30,7 +30,7 @@ metadata:
|
|
30
30
|
homepage_uri: https://github.com/ddnexus/rematch
|
31
31
|
bug_tracker_uri: https://github.com/ddnexus/rematch/issues
|
32
32
|
changelog_uri: https://github.com/ddnexus/rematch/blob/master/CHANGELOG.md
|
33
|
-
post_install_message:
|
33
|
+
post_install_message:
|
34
34
|
rdoc_options: []
|
35
35
|
require_paths:
|
36
36
|
- lib
|
@@ -45,8 +45,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
48
|
-
rubygems_version: 3.5.
|
49
|
-
signing_key:
|
48
|
+
rubygems_version: 3.5.11
|
49
|
+
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: Declutter your test files from large hardcoded data and update them automatically
|
52
52
|
when your code changes
|