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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b55b1aac3c8f7485efb46cf9ae2d62099d074f8c57c41d8a0b649ee6d7040c7f
4
- data.tar.gz: 0e6d00759c134fe74c0b627fcbb40757825e959adffdd9ffa3599e68584bc954
3
+ metadata.gz: 4668f539ce7c95d76e77eab406e9b7dd1a8a5cf50265b60309b8da6d3c2564a1
4
+ data.tar.gz: ecf7a28db05aa850e7fec2b413e9b13dfe9c917eee5747c68fb22eab3bf10471
5
5
  SHA512:
6
- metadata.gz: c2ff25eb3ebc46a01852c4f2147a862cb8d9b94c2277aaadc9d331608d27cf4d0348c74521196c0c36d234827a274533dce1445ac91ba6f8c478d81a5605c59f
7
- data.tar.gz: 3bf7ba016e5e47aa87bec679e06e48b0e54cf03f68f67e794bb065f351fdd09f314563e2053dc8d97d5a5d406f57df85cb71206087fda4738d5b7581a7b666b0
6
+ metadata.gz: 5fa621abf5030844e59efe1e5b3c2846debaaf9905bc4506c5d4be6481e9f549b3b4df84365867e2ba7c021fcc56d3262f374c9d0fcd5cc2f0d53d7e4ed925d9
7
+ data.tar.gz: 2b8425fad9b2f564d05b1d9ffbce831368d279321ccfb8747e25fce6f4c4e45a2e7ce44c79ab9b4ca803a4a20c8438f6e2c3d44555b458cb65789cda0fd1570d
@@ -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@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
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@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
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 [![Build Status]!](https://github.com/github/docs/actions/workflows/ci.yml/badge.svg?branch=master)
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
- ### Rake commands
157
+ ### Installing the gem locally
158
158
 
159
- To install this gem onto your local machine, run `bundle exec rake install`. To
160
- release a new version, update the version number in `version.rb`, and then run
161
- `bundle exec rake release`, which will create a git tag for the version, push
162
- git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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
- FileUtils.mkdir_p(snapshot_dir)
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.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Snapshot
5
- VERSION = '2.0.2'
5
+ VERSION = '2.0.3'
6
6
  end
7
7
  end
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.2
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: 2023-12-15 00:00:00.000000000 Z
11
+ date: 2024-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print