rematch 1.0 → 1.1.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 +4 -4
- data/lib/rematch.rb +8 -9
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 436705eae5a3606fde733d091c5af71bb539da4187080c7527dca36a440c1684
|
4
|
+
data.tar.gz: 5543594f5f10f4c3021cd9a5947a938c4e3b04b34f3ce0086dcde4da6698ef46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34b831ff01adca363cbc924ededdebd6f801ea87f5d71e9fd1ca259f6c40d92bfd3eed39ceed3153b72aaaa352964e2f2337ae17111e896c33716f969c413d34
|
7
|
+
data.tar.gz: 1dd5425ccc6be7505956f06680aa7f8e5be90acdc0822a79fb8477a4142dc3afb101b8bf8c74d508065c08865ba9ff5d5df9826cd8a171a777cd8e6a49bbf9e5
|
@@ -5,8 +5,8 @@ require 'rematch'
|
|
5
5
|
# Implement the minitest plugin
|
6
6
|
module Minitest
|
7
7
|
def self.plugin_rematch_options(opts, _options)
|
8
|
-
opts.on '--rematch-
|
9
|
-
Rematch.
|
8
|
+
opts.on '--rematch-rebuild', 'Rebuild the stores with the current entries/values' do
|
9
|
+
Rematch.rebuild = true
|
10
10
|
end
|
11
11
|
end
|
12
12
|
class Test
|
@@ -16,8 +16,8 @@ module Minitest
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
module Assertions
|
19
|
-
def assert_rematch(
|
20
|
-
|
19
|
+
def assert_rematch(equality, actual)
|
20
|
+
send :"assert_#{equality||:equal}", @rematch.rematch(actual), actual
|
21
21
|
end
|
22
22
|
end
|
23
23
|
module Expectations
|
data/lib/rematch.rb
CHANGED
@@ -5,25 +5,24 @@ require 'fileutils'
|
|
5
5
|
|
6
6
|
# Implement the key/value store
|
7
7
|
class Rematch
|
8
|
-
VERSION = '1.0'
|
8
|
+
VERSION = '1.1.0'
|
9
9
|
EXT = '.rematch'
|
10
10
|
|
11
|
-
@
|
11
|
+
@rebuilt = []
|
12
12
|
class << self
|
13
|
-
attr_accessor :
|
14
|
-
|
15
|
-
|
16
|
-
return unless @refresh && !@refreshed.include?(path)
|
13
|
+
attr_accessor :rebuild
|
14
|
+
def check_rebuild(path)
|
15
|
+
return unless @rebuild && !@rebuilt.include?(path)
|
17
16
|
FileUtils.rm_f(path)
|
18
|
-
@
|
19
|
-
puts "
|
17
|
+
@rebuilt << path
|
18
|
+
puts "Rebuilt #{path}"
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
22
|
# path and unique id of the test being run
|
24
23
|
def initialize(path:, id:)
|
25
24
|
path = "#{path}#{EXT}"
|
26
|
-
self.class.
|
25
|
+
self.class.check_rebuild(path)
|
27
26
|
@store = YAML::Store.new(path, true)
|
28
27
|
@id = id
|
29
28
|
@count = 0
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rematch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.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-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
13
|
+
description: Instead of copying and pasting large outputs or big ruby structures into
|
14
|
+
all the affected test files every time your code change, you can do it the easy
|
15
|
+
way, possibly saving many hours of boring maintenance work!
|
15
16
|
email:
|
16
17
|
- dd.nexus@gmail.com
|
17
18
|
executables: []
|
@@ -43,5 +44,6 @@ requirements: []
|
|
43
44
|
rubygems_version: 3.2.15
|
44
45
|
signing_key:
|
45
46
|
specification_version: 4
|
46
|
-
summary:
|
47
|
+
summary: Declutter your test files from large hardcoded data and update them automatically
|
48
|
+
when your code changes
|
47
49
|
test_files: []
|