minitest-snapshots 1.0.2 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- 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: d5e0c4ad221347ed468ace0867598ae308fff02881507f4be2c6b6dcd3300d59
|
4
|
+
data.tar.gz: 8dd3239391500dc0a6af5d4fcd81c48e64e31d91968477a867adb35b227df246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72052de4e375ac7ac82811bc401721f82a966a3a05917b7be05055fac2eff81036a7b6de8c6a674596766e30d1e9b15d7df8062914f53f83d3dfc7dba634016b
|
7
|
+
data.tar.gz: d789488d013cfdb38b2230e185baca25420d26dfa189bf971d27338fb8a5d01b6fd7c5a8f58f7d6ff868657d0edb517482a2f5af08c6b5e06d0f70472e29da09
|
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.
|
4
|
+
version: 1.1.1
|
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-07-09 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.11
|
55
55
|
signing_key:
|
56
56
|
specification_version: 4
|
57
57
|
summary: Minitest plugin implementing Jest-style snapshot testing
|