rspec-request_snapshot 0.3.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea875af5bb2032c8034482032dc737d7ec60b55e2f977551adddee0d0bb5f0cf
4
- data.tar.gz: 946666e33db659d180bd8762d8cbfc1400f1bcd28c25725a3cc13d639486385e
3
+ metadata.gz: d9ab83e5c6e363af7b0fd232652ff9aad21a4e92be390e7b0cd14472efede05f
4
+ data.tar.gz: '09680d62f5bb393fea32254078ddc280b10ee53627d7840d13fa643d84ef1572'
5
5
  SHA512:
6
- metadata.gz: b78cc8aa841430a3d9134b263bd092e31ddadb9b91fee63683dadf9ed856730ecae3d4844d2bcec0d230c2e2e3559f9617d1940c8435925fc0221bcf7614f05b
7
- data.tar.gz: 1b327bc6fec76fda28c437a6093e2d43fb025af9361dde518ee8e11f1a7967da1cd88b889fa71a4d76e0df4e75f93642d7b327e62186ed0c1402a35dde7751f9
6
+ metadata.gz: 525dd5eb810666c52b50235f1cbb31311561121a80a67264d2743026adede323c6327b1eb25527776ca843b3528dce811615f0e9bdae26b3e77e583d5d22aaf7
7
+ data.tar.gz: 1c2e330b6484c96d63b6f3dec4b942bd57e1f90612553b9a3cccfabca7e5796845d1296f40a1c8d4bc0eb662b8f00708095f483a04a4d2c6814122d7df17f5cf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-request_snapshot (0.3.0)
4
+ rspec-request_snapshot (0.4.0)
5
5
  rspec (~> 3.0)
6
6
 
7
7
  GEM
@@ -40,4 +40,4 @@ DEPENDENCIES
40
40
  simplecov (~> 0.16.1)
41
41
 
42
42
  BUNDLED WITH
43
- 1.16.2
43
+ 1.16.6
data/README.md CHANGED
@@ -5,8 +5,9 @@ Gold master testing for RSpec API request specs. Make sure API behavior is not c
5
5
  By default, snapshots are stored under `spec/fixtures/snapshots` and should be code reviewed as well. The syntax is inspired by Jest.
6
6
 
7
7
  References:
8
- - [Gold Master Testing article by CodeClimate](https://codeclimate.com/blog/gold-master-testing/)
9
- - [Jest Snapshot Testing](https://jestjs.io/docs/en/snapshot-testing)
8
+
9
+ * [Gold Master Testing article by CodeClimate](https://codeclimate.com/blog/gold-master-testing/)
10
+ * [Jest Snapshot Testing](https://jestjs.io/docs/en/snapshot-testing)
10
11
 
11
12
  ## Installation
12
13
 
@@ -37,6 +38,10 @@ RSpec.configure do |config|
37
38
  # The json attributes that you want to ignore when comparing snapshots
38
39
  # Default value is [id, created_at, updated_at]
39
40
  config.request_snapshots_dynamic_attributes = %w(id created_at updated_at)
41
+
42
+ # The json attributes that ignore order when comparing nodes
43
+ # Default value is []
44
+ config.request_snapshots_ignore_order = %w(array_node)
40
45
  end
41
46
  ```
42
47
 
@@ -2,5 +2,6 @@ module Rspec::RequestSnapshot
2
2
  RSpec.configure do |config|
3
3
  config.add_setting :request_snapshots_dir, default: "spec/fixtures/snapshots"
4
4
  config.add_setting :request_snapshots_dynamic_attributes, default: %w(id created_at updated_at)
5
+ config.add_setting :request_snapshots_ignore_order, default: %w()
5
6
  end
6
7
  end
@@ -10,7 +10,8 @@ module Rspec::RequestSnapshot::Handlers
10
10
  end
11
11
 
12
12
  def ignore_order
13
- @ignore_order ||= @options[:ignore_order] || []
13
+ @ignore_order ||= RSpec.configuration.request_snapshots_ignore_order |
14
+ Array(@options[:ignore_order])
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module RequestSnapshot
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.4.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-request_snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Campos