rspec-snapshot 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -5
- data/README.md +13 -6
- data/lib/rspec/snapshot/file_operator.rb +4 -2
- data/lib/rspec/snapshot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4668f539ce7c95d76e77eab406e9b7dd1a8a5cf50265b60309b8da6d3c2564a1
|
4
|
+
data.tar.gz: ecf7a28db05aa850e7fec2b413e9b13dfe9c917eee5747c68fb22eab3bf10471
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa621abf5030844e59efe1e5b3c2846debaaf9905bc4506c5d4be6481e9f549b3b4df84365867e2ba7c021fcc56d3262f374c9d0fcd5cc2f0d53d7e4ed925d9
|
7
|
+
data.tar.gz: 2b8425fad9b2f564d05b1d9ffbce831368d279321ccfb8747e25fce6f4c4e45a2e7ce44c79ab9b4ca803a4a20c8438f6e2c3d44555b458cb65789cda0fd1570d
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
on:
|
2
2
|
push:
|
3
|
+
pull_request:
|
3
4
|
|
4
5
|
jobs:
|
5
6
|
lint:
|
6
7
|
runs-on: ubuntu-latest
|
7
8
|
strategy:
|
8
9
|
matrix:
|
9
|
-
ruby-version: ['3.2', '3.1', '3.0', '2.7']
|
10
|
+
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
|
10
11
|
defaults:
|
11
12
|
run:
|
12
13
|
shell: bash
|
13
14
|
steps:
|
14
15
|
- uses: actions/checkout@v4
|
15
|
-
- uses: ruby/setup-ruby@
|
16
|
+
- uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88
|
16
17
|
with:
|
17
18
|
ruby-version: ${{ matrix.ruby-version }}
|
18
19
|
- run: gem install bundler:2.4.22
|
@@ -24,16 +25,16 @@ jobs:
|
|
24
25
|
runs-on: ubuntu-latest
|
25
26
|
strategy:
|
26
27
|
matrix:
|
27
|
-
ruby-version: ['3.2', '3.1', '3.0', '2.7']
|
28
|
+
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']
|
28
29
|
defaults:
|
29
30
|
run:
|
30
31
|
shell: bash
|
31
32
|
steps:
|
32
33
|
- uses: actions/checkout@v4
|
33
|
-
- uses: ruby/setup-ruby@
|
34
|
+
- uses: ruby/setup-ruby@360dc864d5da99d54fcb8e9148c14a84b90d3e88
|
34
35
|
with:
|
35
36
|
ruby-version: ${{ matrix.ruby-version }}
|
36
37
|
- run: gem install bundler:2.4.22
|
37
38
|
- run: bundle install
|
38
39
|
- run: cat Gemfile.lock
|
39
|
-
- run: bundle exec rspec
|
40
|
+
- run: bundle exec rspec
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# RSpec::Snapshot
|
1
|
+
# RSpec::Snapshot ![Build Status](https://github.com/levinmr/rspec-snapshot/actions/workflows/ci.yml/badge.svg?branch=master)
|
2
2
|
|
3
3
|
Adds snapshot testing to RSpec, inspired by [Jest](https://jestjs.io/).
|
4
4
|
|
@@ -154,12 +154,19 @@ Install a current version of ruby (> 2.5) and bundler. Then install gems
|
|
154
154
|
|
155
155
|
$ bin/console
|
156
156
|
|
157
|
-
###
|
157
|
+
### Installing the gem locally
|
158
158
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
159
|
+
$ bundle exec rake install
|
160
|
+
|
161
|
+
### Publishing a new gem version
|
162
|
+
|
163
|
+
* Update the version number in `version.rb`
|
164
|
+
* Ensure the changes to be published are merged to the master branch
|
165
|
+
* Checkout the master branch locally
|
166
|
+
* Run `bundle exec rake release`, which will:
|
167
|
+
* create a git tag for the version
|
168
|
+
* push git commits and tags
|
169
|
+
* push the `.gem` file to [rubygems.org](https://rubygems.org).
|
163
170
|
|
164
171
|
## Contributing
|
165
172
|
|
@@ -13,8 +13,8 @@ module RSpec
|
|
13
13
|
# @param [Hash] metadata The RSpec metadata for the current test.
|
14
14
|
def initialize(snapshot_name, metadata)
|
15
15
|
snapshot_dir = snapshot_dir(metadata)
|
16
|
-
create_snapshot_dir(snapshot_dir)
|
17
16
|
@snapshot_path = File.join(snapshot_dir, "#{snapshot_name}.snap")
|
17
|
+
create_snapshot_dir(@snapshot_path)
|
18
18
|
end
|
19
19
|
|
20
20
|
private def snapshot_dir(metadata)
|
@@ -26,7 +26,9 @@ module RSpec
|
|
26
26
|
end
|
27
27
|
|
28
28
|
private def create_snapshot_dir(snapshot_dir)
|
29
|
-
|
29
|
+
return if Dir.exist?(File.dirname(snapshot_dir))
|
30
|
+
|
31
|
+
FileUtils.mkdir_p(File.dirname(snapshot_dir))
|
30
32
|
end
|
31
33
|
|
32
34
|
# @return [String] The snapshot file contents.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Levin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|