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 +4 -4
- data/lib/minitest/rematch_plugin.rb +4 -19
- data/lib/rematch.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 517a212dcc929a169a02fb05526206e64ee3aa4f9a9dced33a76d0c0bca20698
|
|
4
|
+
data.tar.gz: e1764805c826d287daf49ec747551e86a8736ba2cc572e5a3d7b7eea9fe3d923
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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