rematch 2.0.0 → 3.0.0

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: 785b035990ab3f3b2615c20211f0714b475adc30c2b10340b22fc2c3aedb3ab4
4
- data.tar.gz: 1b1cdcc8e0a17a2564aff63e89ff41d652320259d4be90d315704f7fe2a1843b
3
+ metadata.gz: b1c8f28666e75297ba7dfa84ba0432715976075f2a2e1699b145eea7f41789fc
4
+ data.tar.gz: 39c024389c8ccdfd97627952719c2cd0004a69f906b50621e1a9ab9b230e2947
5
5
  SHA512:
6
- metadata.gz: e8ea2ec684a238530b4050d89a63cf4d8454264e5df821122d4857f5ece42cf0f29c63b26bc4cfe8675b60599a85c8f0987d0c9783bf437f62d5ecfcc11c6e9f
7
- data.tar.gz: 981c98f90eb585f57bb0bd8808c43b146b8ab7d8503ef9646620ed1003375a29e29d02bb057b4eb4eecc2a30ba61c1233692d1cd84cf57c372648915824a4b76
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
- send assertion, @rematch.rematch(key, actual), actual, message # assert that the stored value is the same actual value
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 = '2.0.0'
9
- EXT = '.rematch'
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}#{EXT}"
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: 2.0.0
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-01-22 00:00:00.000000000 Z
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.3
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