rematch 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minitest/rematch_plugin.rb +9 -3
- data/lib/rematch.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586bcff5cd631385dd5dd60787cd47220d4367e42a9c34a74f6c2c1617940278
|
4
|
+
data.tar.gz: c5afbca2c06ea0e7c78500c9a2a172e1114251b021e2a257edf278bc031223c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4a5aa9c5247e0789c54736a1b09a69ffe5aed69f0035c2fe8a79c98b52b20e21a2ce727d331520df969dbb593298cca1efc8ac0d6f4e153aa94422e964e04b
|
7
|
+
data.tar.gz: abfdbf717e06179fd84e3a37348a4272e5fa207a859761a50f0b3b3debab6806a95c3595165c522b87e01226cc13859b1ce9d0e01040bc2e6f86e648f83e960f
|
@@ -9,18 +9,24 @@ module Minitest
|
|
9
9
|
Rematch.rebuild = true
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
13
|
+
# reopen the minitest class
|
12
14
|
class Test
|
13
15
|
def before_setup
|
14
16
|
super
|
15
17
|
@rematch = Rematch.new(path: method(name).source_location.first, id: location)
|
16
18
|
end
|
17
19
|
end
|
20
|
+
|
21
|
+
# reopen the minitest module
|
18
22
|
module Assertions
|
19
|
-
def assert_rematch(
|
20
|
-
send
|
23
|
+
def assert_rematch(actual, assert_method = :assert_equal)
|
24
|
+
send assert_method, @rematch.rematch(actual), actual
|
21
25
|
end
|
22
26
|
end
|
27
|
+
|
28
|
+
# reopen the minitest module
|
23
29
|
module Expectations
|
24
|
-
infect_an_assertion :assert_rematch, :must_rematch
|
30
|
+
infect_an_assertion :assert_rematch, :must_rematch, true # dont_flip
|
25
31
|
end
|
26
32
|
end
|
data/lib/rematch.rb
CHANGED
@@ -5,14 +5,16 @@ require 'fileutils'
|
|
5
5
|
|
6
6
|
# Implement the key/value store
|
7
7
|
class Rematch
|
8
|
-
VERSION = '1.
|
8
|
+
VERSION = '1.2.0'
|
9
9
|
EXT = '.rematch'
|
10
10
|
|
11
11
|
@rebuilt = []
|
12
12
|
class << self
|
13
13
|
attr_accessor :rebuild
|
14
|
+
|
14
15
|
def check_rebuild(path)
|
15
16
|
return unless @rebuild && !@rebuilt.include?(path)
|
17
|
+
|
16
18
|
FileUtils.rm_f(path)
|
17
19
|
@rebuilt << path
|
18
20
|
puts "Rebuilt #{path}"
|
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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-21 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
|