minitest-holdify 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd9cfe38c2cb4dc5fb508261f9b89e107dcbcdb01902018ca30cd68f713bec4e
4
- data.tar.gz: 487b7577edbeec62c7e2bd26f6dc7dc0af71fe6eae1915160265057c2efaf32e
3
+ metadata.gz: 6a833738964de4fd5b67fbb6c68a1238e62077ed8716c4c37016e430234280a9
4
+ data.tar.gz: bf3e156990631e915295f4109b3bacd6f3e4553e3f155a5d0559ea9172421e42
5
5
  SHA512:
6
- metadata.gz: b606c8de07fa255ee00025c26697b539092bd5ed44f5d01790ce96a115542186ab6371c3006eed5030f7f01c2f7264d9dcec4389964784daa112ada0ba61dbba
7
- data.tar.gz: 2e448c696404d64f7a1491fb7fe6cdc90c4c4da7dc37df44f8a7e437d195b61d360bdc17b3751c61d4ceefcf3e38698aa64af4012406a8afa1731dec8e47e8dd
6
+ metadata.gz: 7cdf43d2f02bbf34a5011d8808b27d0ca8ec1f9619d7c1caefc01a9e8b68f4176bd7ff1cfe5c301ec93d9176925c9ea2033374f7753b57b629846c4c69abc2aa
7
+ data.tar.gz: a1db8f0d6d12bf7b68fca7144a073dfc6ad55676452bb187003c9c4dced2a6a910db9156cb86eadd2b393859a5f7a12ddc0845b783a0094e750994a24c29823c
data/lib/holdify/store.rb CHANGED
@@ -8,7 +8,7 @@ class Holdify
8
8
  class Store
9
9
  def initialize(source_path)
10
10
  @path = "#{source_path}#{CONFIG[:ext]}"
11
- File.delete(@path) if Holdify.rebuild && File.exist?(@path)
11
+ File.delete(@path) if Holdify.reconcile && File.exist?(@path)
12
12
 
13
13
  @source = {} # { lineno => id }
14
14
  File.foreach(source_path).with_index(1) do |line, lineno|
data/lib/holdify.rb CHANGED
@@ -5,11 +5,11 @@ require_relative 'holdify/store'
5
5
 
6
6
  # Add description
7
7
  class Holdify
8
- VERSION = '1.0.0'
8
+ VERSION = '1.0.2'
9
9
  CONFIG = { ext: '.yaml' }.freeze
10
10
 
11
11
  class << self
12
- attr_accessor :rebuild, :quiet
12
+ attr_accessor :reconcile, :quiet
13
13
 
14
14
  def stores = @stores ||= {}
15
15
  end
@@ -32,7 +32,7 @@ class Holdify
32
32
  @session[id] << actual
33
33
  @forced << "#{location.path}:#{location.lineno}" if force
34
34
 
35
- return actual if force || self.class.rebuild
35
+ return actual if force || self.class.reconcile
36
36
 
37
37
  stored = @store.stored(id)
38
38
  index = @session[id].size - 1
@@ -6,9 +6,9 @@ require 'holdify'
6
6
  module Minitest
7
7
  # Set the Holdify options
8
8
  def self.plugin_holdify_options(opts, _options)
9
- opts.on '--holdify-rebuild', 'Rebuild the stores with the current entries/values' do
10
- Holdify.rebuild = true
11
- Holdify.quiet = true
9
+ opts.on '--holdify-reconcile', 'Reconcile the held values with the new ones' do
10
+ Holdify.reconcile = true
11
+ Holdify.quiet = true
12
12
  end
13
13
  # :nocov:
14
14
  opts.on '--holdify-quiet', 'Skip the warning on storing a new value' do
@@ -65,7 +65,7 @@ module Minitest
65
65
  def assert_hold_?(actual, *)
66
66
  @holdify ||= Holdify.new(self)
67
67
  location = @holdify.find_location
68
- warn "[holdify] Actual value dumped from: #{location.path}:#{location.lineno}\n=> #{actual.inspect}"
68
+ warn "[holdify] Actual value from: #{location.path}:#{location.lineno}\n=> #{actual.inspect}"
69
69
  @holdify.hold(actual)
70
70
  end
71
71
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "holdify"
3
+ require_relative 'holdify'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-holdify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
@@ -23,10 +23,8 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 5.0.0
26
- description: Holdify eliminates the burden of maintaining large expected values into
27
- your test files. It behaves as if the expected value were hardcoded inline, but
28
- keeps it stored externally. This ensures your values hold true without polluting
29
- your test files, and allows for effortless updates when your code changes.
26
+ description: Stop maintaining large expected values in your test/fixture files! Hold
27
+ them automatically. Update them effortlessly.
30
28
  email:
31
29
  - dd.nexus@gmail.com
32
30
  executables: []
@@ -62,5 +60,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
60
  requirements: []
63
61
  rubygems_version: 3.6.9
64
62
  specification_version: 4
65
- summary: Hardcoded values suck! Hold them inline!
63
+ summary: Hardcoded values suck! Holdify them.
66
64
  test_files: []