rematch 1.1.0 → 1.2.0

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: 436705eae5a3606fde733d091c5af71bb539da4187080c7527dca36a440c1684
4
- data.tar.gz: 5543594f5f10f4c3021cd9a5947a938c4e3b04b34f3ce0086dcde4da6698ef46
3
+ metadata.gz: 586bcff5cd631385dd5dd60787cd47220d4367e42a9c34a74f6c2c1617940278
4
+ data.tar.gz: c5afbca2c06ea0e7c78500c9a2a172e1114251b021e2a257edf278bc031223c6
5
5
  SHA512:
6
- metadata.gz: 34b831ff01adca363cbc924ededdebd6f801ea87f5d71e9fd1ca259f6c40d92bfd3eed39ceed3153b72aaaa352964e2f2337ae17111e896c33716f969c413d34
7
- data.tar.gz: 1dd5425ccc6be7505956f06680aa7f8e5be90acdc0822a79fb8477a4142dc3afb101b8bf8c74d508065c08865ba9ff5d5df9826cd8a171a777cd8e6a49bbf9e5
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(equality, actual)
20
- send :"assert_#{equality||:equal}", @rematch.rematch(actual), actual
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.1.0'
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.1.0
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-20 00:00:00.000000000 Z
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