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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1813bfb1bfccc23e799726c867fd49509f9ae93935206a57a295259b5ca4533
4
- data.tar.gz: f595fc1f3d2057969f68f8f2417831d7f22ff71d2abdff1341cd62df853b7e4a
3
+ metadata.gz: 436705eae5a3606fde733d091c5af71bb539da4187080c7527dca36a440c1684
4
+ data.tar.gz: 5543594f5f10f4c3021cd9a5947a938c4e3b04b34f3ce0086dcde4da6698ef46
5
5
  SHA512:
6
- metadata.gz: 907b7286d879fa6678598fcd60b1476b2e1f652cc4060bee23eaaab14b1a2dac7c3cbb6549e2391261e73ab9278e7276fbf00ee4fe2240ff6bd441436280f9eb
7
- data.tar.gz: eb3ef411ce825152c59028f8cad7553971cdee632b252f43297acd3133241dc83cc5cedd683f208c5067c8eb748eb0cb144c4fd8ed72ef30ac49934140471171
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-refresh-only', 'ONLY Refresh the stored values with the current values' do
9
- Rematch.refresh = true
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(_expected, actual)
20
- assert_equal(@rematch.rematch(actual), actual)
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
- @refreshed = []
11
+ @rebuilt = []
12
12
  class << self
13
- attr_accessor :refresh
14
-
15
- def check_refresh(path)
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
- @refreshed << path
19
- puts "Refresh #{path}"
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.check_refresh(path)
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: '1.0'
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-19 00:00:00.000000000 Z
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Declutter your test files from large hardcoded data and update them automatically
14
- when your code changes
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: Rematch expected test values with automatically stored values
47
+ summary: Declutter your test files from large hardcoded data and update them automatically
48
+ when your code changes
47
49
  test_files: []