minitest-snapshots 1.0.1 → 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: df1eab7b656ef41c119840132f47702d15dc99fc14eb88b4a47614046bf1694e
4
- data.tar.gz: 57b540192a37e77075dac98a026bc2dcb864e50f7a33752dfac979be6c000a53
3
+ metadata.gz: d503397f69415e8da16d8f796cfa0b37938852ab971eba1c9f8b18050a540620
4
+ data.tar.gz: 25bf0494cc3567fb2352a7cb5757ce57410306759ef01fc726bb69fc71927dad
5
5
  SHA512:
6
- metadata.gz: 5b581de57a56296cce3378f59e9ba6d08a3708378068abd8f3004eff456775b78cf7435778c3505fb67ebc5a0d71c658e2b16d7d35013444ba95606dd161fa7a
7
- data.tar.gz: f4458793636fdf47fbba8002250e6128ce90b0f326312ccad9ac23ab3b20f65924c088130cd1884be85dbd80c44ef4f361f3f456445882e4da568251ca3b6710
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.1".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.1
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: 2023-10-03 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.4.19
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