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 +4 -4
- data/README.md +6 -2
- data/lib/minitest/snapshots/version.rb +1 -1
- data/lib/minitest/snapshots_plugin.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d503397f69415e8da16d8f796cfa0b37938852ab971eba1c9f8b18050a540620
|
4
|
+
data.tar.gz: 25bf0494cc3567fb2352a7cb5757ce57410306759ef01fc726bb69fc71927dad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
34
|
+
bin/rails test -u
|
35
|
+
|
36
|
+
In a Rake project:
|
37
|
+
|
38
|
+
rake test TESTOPTS=-u
|
35
39
|
|
36
40
|
## Installation
|
37
41
|
|
@@ -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 =
|
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
|
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-
|
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.
|
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
|