minitest-snapshots 1.0.2 → 1.1.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: '04618d0a271308ebd2b3e7103cd860af5f69c58456368ee2a7321b09b62b562d'
4
- data.tar.gz: 9c2d2563866b3ceea0adebdd235813c2891537a8b8001589c9e60be6cf695b62
3
+ metadata.gz: d503397f69415e8da16d8f796cfa0b37938852ab971eba1c9f8b18050a540620
4
+ data.tar.gz: 25bf0494cc3567fb2352a7cb5757ce57410306759ef01fc726bb69fc71927dad
5
5
  SHA512:
6
- metadata.gz: 8f4c580259d3d17c256f069844318a6ab857506ec24874ab153e3c4f8541305aa52998ff516acad38796555eb0fcd72124ac1b687bd6c551937e2352291ea1a6
7
- data.tar.gz: e3e312e90a1dac0e1d9ac960ee2c22dc5631d7a56e468246123c31706da82917139f214d04bd35f04802d2c9140a3042473cd17d120e9e879d8c86e5b0f86f0b
6
+ metadata.gz: 33db7d237d136b6d7b73d31f331b62edd5df0de5bbcfbae2312d27af9b467956ac2c21f5aad54a0e190db284c6c7da0065446340c7a8d0b9bf2824b90b4180de
7
+ data.tar.gz: dc7644b03771ef432d665dcd0750310794939a7bffc4eb7f2b3449f20ac08d30cffbb658785adde669136f37eafca43d86d7d73d76c9d833de5b49d8a58d7ffd
data/README.md CHANGED
@@ -27,11 +27,15 @@ end
27
27
  ## Command line options
28
28
 
29
29
  - `-u` or `--update-snapshots`: Update snapshots on disk to the new actual value when re-running the test. Useful when you know the new output of a test case is correct and the snapshot is out of date.
30
- - `-l` or `--lock-snapshots`: Prevents new snapshots from being written. Useful on CI to ensure all snapshots have been written by the developer.
30
+ - `-l` or `--lock-snapshots`: Prevents new snapshots from being written. This is enabled by default in CI (i.e. when the `CI` env var is present).
31
31
 
32
32
  For example, to update snapshots on a Rails project:
33
33
 
34
- $ bin/rails test -u
34
+ bin/rails test -u
35
+
36
+ In a Rake project:
37
+
38
+ rake test TESTOPTS=-u
35
39
 
36
40
  ## Installation
37
41
 
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Snapshots
3
- VERSION = "1.0.2".freeze
3
+ VERSION = "1.1.0".freeze
4
4
  end
5
5
  end
@@ -3,12 +3,14 @@ require_relative "snapshots/version"
3
3
 
4
4
  module Minitest
5
5
  def self.plugin_snapshots_options(opts, _options)
6
+ Minitest::Snapshots.lock_snapshots = !ENV["CI"].to_s.empty?
7
+
6
8
  opts.on "-u", "--update-snapshots", "Update (overwrite) stored snapshots" do
7
9
  Minitest::Snapshots.force_updates = true
8
10
  end
9
11
 
10
- opts.on "-l", "--lock-snapshots", "Prevent any snapshots from being stored" do
11
- Minitest::Snapshots.lock_snapshots = true
12
+ opts.on "-l", "--[no-]lock-snapshots", "Prevent any snapshots from being stored" do |bool|
13
+ Minitest::Snapshots.lock_snapshots = bool
12
14
  end
13
15
  end
14
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-snapshots
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Brundage
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-01-09 00:00:00.000000000 Z
12
+ date: 2024-03-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email:
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubygems_version: 3.5.3
54
+ rubygems_version: 3.5.6
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: Minitest plugin implementing Jest-style snapshot testing