minitest-snapshots 1.1.5 → 1.2.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 +7 -0
- data/lib/minitest/snapshots/version.rb +1 -1
- data/lib/minitest/snapshots.rb +1 -17
- data/lib/minitest/snapshots_plugin.rb +18 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ece208af5acd04a9ff20e024ac9abcdaa7b3f38b0dd97e4bb5f5b8734900887
|
|
4
|
+
data.tar.gz: f30062a21361126cf5abe5e3e442508e02d33aabc1af82e82d6cbbe5f6d3a835
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a25d8bd6a1c664b28bd7517e9cbfed3641e2b2904792cc19458b9a38e44966745ab1d74a7a7771504bd5a20192eaaf190d19bd11825bd2a97d0eedecf25da34b
|
|
7
|
+
data.tar.gz: e40ff25a41c718c61cacd925d8c2d32b8a5cea153bfd9359491bd64a69c4a09cb75bb7ff867ab22a191a6211e0e2d72a327fbbc7fc084fbca67ae05a3c74c468
|
data/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Simple minitest plugin gem implementing Jest-style snapshot testing. It's like V
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
11
|
- Ruby 2.7 or later
|
|
12
|
+
- Minitest 5 or later
|
|
12
13
|
|
|
13
14
|
## Usage
|
|
14
15
|
|
|
@@ -53,6 +54,12 @@ Or install it yourself as:
|
|
|
53
54
|
|
|
54
55
|
$ gem install minitest-snapshots
|
|
55
56
|
|
|
57
|
+
If you are using Minitest 6 or later, you may need to add this line to your `test_helper.rb` or equivalent:
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
require "minitest/snapshots"
|
|
61
|
+
```
|
|
62
|
+
|
|
56
63
|
## Development
|
|
57
64
|
|
|
58
65
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/minitest/snapshots.rb
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
require "minitest"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
class << self
|
|
5
|
-
attr_accessor :force_updates, :lock_snapshots
|
|
6
|
-
|
|
7
|
-
def default_snapshots_directory
|
|
8
|
-
if defined?(Rails) && Rails.respond_to?(:root)
|
|
9
|
-
Rails.root.join("test", "snapshots").to_s
|
|
10
|
-
elsif Dir.exist?("test")
|
|
11
|
-
File.expand_path("test/snapshots")
|
|
12
|
-
elsif Dir.exist?("spec")
|
|
13
|
-
File.expand_path("spec/snapshots")
|
|
14
|
-
else
|
|
15
|
-
File.expand_path("snapshots")
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
3
|
+
Minitest.load(:snapshots) unless Minitest::VERSION.to_i < 6
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require_relative "snapshots"
|
|
2
1
|
require_relative "snapshots/version"
|
|
3
2
|
|
|
4
3
|
module Minitest
|
|
@@ -19,4 +18,22 @@ module Minitest
|
|
|
19
18
|
require_relative "snapshots/assertion_extensions"
|
|
20
19
|
Minitest::Test.include Minitest::Snapshots::TestExtensions
|
|
21
20
|
end
|
|
21
|
+
|
|
22
|
+
module Snapshots
|
|
23
|
+
class << self
|
|
24
|
+
attr_accessor :force_updates, :lock_snapshots
|
|
25
|
+
|
|
26
|
+
def default_snapshots_directory
|
|
27
|
+
if defined?(Rails) && Rails.respond_to?(:root)
|
|
28
|
+
Rails.root.join("test", "snapshots").to_s
|
|
29
|
+
elsif Dir.exist?("test")
|
|
30
|
+
File.expand_path("test/snapshots")
|
|
31
|
+
elsif Dir.exist?("spec")
|
|
32
|
+
File.expand_path("spec/snapshots")
|
|
33
|
+
else
|
|
34
|
+
File.expand_path("snapshots")
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
22
39
|
end
|
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.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Harry Brundage
|
|
@@ -9,7 +9,21 @@ authors:
|
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
|
-
dependencies:
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: minitest
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '5'
|
|
13
27
|
email:
|
|
14
28
|
- harry.brundage@gmail.com
|
|
15
29
|
- opensource@mattbrictson.com
|