rematch 3.2.1 → 3.2.2

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: 150055b455fefcd4f49e818c38c57241acc07afb1fa2ce70e22e35c9df9c19b8
4
- data.tar.gz: 52eed7dc443edbc90bb932a48d019d7871fce611d07bff83f663c798716066b0
3
+ metadata.gz: 517a212dcc929a169a02fb05526206e64ee3aa4f9a9dced33a76d0c0bca20698
4
+ data.tar.gz: e1764805c826d287daf49ec747551e86a8736ba2cc572e5a3d7b7eea9fe3d923
5
5
  SHA512:
6
- metadata.gz: 62464af5e1e8f5b770f6a33014eda611d2ad6a835321fba1b9f717e9efad38db36dd5ddf2694b50321f6b2695a2bf191655285b2471a038d62765659d51c872a
7
- data.tar.gz: bf035d5b5ffa367dded7aedb2177a09825476894498f3ab7f5050b9bc05487365e624fcaecc7d4c78b7f4f45e499594518e76b27192967ce75df4b82d690a41d
6
+ metadata.gz: b6ab2b85043428cd063a52ceaf93bd5e5a05a73d8d795946bdfdffecffdb19e7c4b545ea076cc633e87038947074d657574ebe0914fd254eff633c770a8444a6
7
+ data.tar.gz: 38a7dd07e06f54900417e7a8344a34777a018380c157342f741f3b956bbb3bbcc24b900692dd9f096437fa7d75df55de0de8fe904c44bc7cd0249a96f56a36db
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rematch'
4
- require 'minitest/spec'
5
4
 
6
5
  # Implement the minitest plugin
7
6
  module Minitest
@@ -49,24 +48,10 @@ module Minitest
49
48
  raise Minitest::Assertion, '[rematch] the value has been stored: remove the "store_" prefix to pass the test'
50
49
  end
51
50
  end
52
- # Reopen the Minitest::Expectation class for Minitest 6 compatibility
53
- # or use infect_an_assertion for Minitest 5
54
- require 'minitest/spec'
55
51
 
56
- if defined?(Expectations) && Expectations.respond_to?(:infect_an_assertion)
57
- module Expectations # rubocop:disable Style/Documentation
58
- infect_an_assertion :assert_rematch, :must_rematch
59
- infect_an_assertion :store_assert_rematch, :store_must_rematch
60
- end
61
- else
62
- class Expectation # rubocop:disable Style/Documentation
63
- def must_rematch(key, *)
64
- ctx.assert_rematch(key, target, *)
65
- end
66
-
67
- def store_must_rematch(key, *)
68
- ctx.store_assert_rematch(key, target, *)
69
- end
70
- end
52
+ # Register expectations only if minitest/spec is loaded; ensure the right class in 6.0 and < 6.0
53
+ if (expectation_class = defined?(Spec) && (defined?(Expectation) ? Expectation : Expectations))
54
+ expectation_class.infect_an_assertion :assert_rematch, :must_rematch
55
+ expectation_class.infect_an_assertion :store_assert_rematch, :store_must_rematch
71
56
  end
72
57
  end
data/lib/rematch.rb CHANGED
@@ -5,7 +5,7 @@ require_relative 'rematch/store'
5
5
 
6
6
  # Handles the key/value store for each test
7
7
  class Rematch
8
- VERSION = '3.2.1'
8
+ VERSION = '3.2.2'
9
9
  CONFIG = { ext: '.yaml' } # rubocop:disable Style/MutableConstant
10
10
 
11
11
  @rebuild = false # rebuild the store?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rematch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis