json_matchers 0.8.0 → 0.9.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/NEWS.md +5 -0
- data/README.md +9 -3
- data/lib/json_matchers/configuration.rb +8 -0
- data/lib/json_matchers/rspec.rb +12 -0
- data/lib/json_matchers/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: 5922bc3d062651cf85a9aa16420365e544abe115adb3e79683360abf06a806e2
|
|
4
|
+
data.tar.gz: 8413dc48cb9588a41149ebb7a710ab358138578f72f22b212a61f809bd784596
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88663040a28f53d62815fb2544a1c3fe7760bd294d99f373f879e7b106d269e5961da3a7a29252888d3be55da242a530cb8d2d5c533b983e4b35bf8db6a46190
|
|
7
|
+
data.tar.gz: 1ec7eba89fcad7f02e0782032c8cdb7938d4ad1d4c575022f183881e8e75d08b8b2c76c16cd46d8eb6fda3fff481abe1cfce287802f71bbf264a1330ad8d2f45
|
data/NEWS.md
CHANGED
data/README.md
CHANGED
|
@@ -116,7 +116,7 @@ def test_GET_posts_returns_Posts
|
|
|
116
116
|
end
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### Passing options to the validator
|
|
119
|
+
### DEPRECATED: Passing options to the validator
|
|
120
120
|
|
|
121
121
|
The matcher accepts options, which it passes to the validator:
|
|
122
122
|
|
|
@@ -137,7 +137,7 @@ A list of available options can be found [here][options].
|
|
|
137
137
|
|
|
138
138
|
[options]: https://github.com/ruby-json-schema/json-schema/blob/2.2.4/lib/json-schema/validator.rb#L160-L162
|
|
139
139
|
|
|
140
|
-
### Global matcher options
|
|
140
|
+
### DEPRECATED: Global matcher options
|
|
141
141
|
|
|
142
142
|
To configure the default options passed to *all* matchers, call
|
|
143
143
|
`JsonMatchers.configure`.
|
|
@@ -152,7 +152,7 @@ end
|
|
|
152
152
|
|
|
153
153
|
A list of available options can be found [here][options].
|
|
154
154
|
|
|
155
|
-
### Default matcher options
|
|
155
|
+
### DEPRECATED: Default matcher options
|
|
156
156
|
|
|
157
157
|
* `record_errors: true` - *NOTE* `json_matchers` will always set
|
|
158
158
|
`record_errors: true`. This cannot be overridden.
|
|
@@ -201,6 +201,12 @@ In this case `"post.json"` will be resolved relative to
|
|
|
201
201
|
|
|
202
202
|
To learn more about `$ref`, check out [Understanding JSON Schema Structuring](http://spacetelescope.github.io/understanding-json-schema/structuring.html)
|
|
203
203
|
|
|
204
|
+
## Upgrading from `0.9.x`
|
|
205
|
+
|
|
206
|
+
After `json_matchers@0.9.x`, calls to `match_json_schema` and
|
|
207
|
+
`match_response_schema` no longer accept options, and `JsonMatchers.configure`
|
|
208
|
+
will been removed.
|
|
209
|
+
|
|
204
210
|
## Contributing
|
|
205
211
|
|
|
206
212
|
Please see [CONTRIBUTING].
|
|
@@ -4,6 +4,14 @@ module JsonMatchers
|
|
|
4
4
|
end
|
|
5
5
|
|
|
6
6
|
def self.configure
|
|
7
|
+
warn <<-WARN
|
|
8
|
+
DEPRECATION: `JsonMatchers.configure`
|
|
9
|
+
After `json_matchers@0.9.x`, JsonMatchers.configure will be removed.
|
|
10
|
+
|
|
11
|
+
See https://github.com/thoughtbot/json_matchers/pull/31 for more information.
|
|
12
|
+
|
|
13
|
+
WARN
|
|
14
|
+
|
|
7
15
|
yield(configuration)
|
|
8
16
|
end
|
|
9
17
|
|
data/lib/json_matchers/rspec.rb
CHANGED
|
@@ -6,6 +6,18 @@ module JsonMatchers
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
RSpec::Matchers.define :match_json_schema do |schema_name, **options|
|
|
9
|
+
if options.present?
|
|
10
|
+
warn <<-WARN
|
|
11
|
+
DEPRECATION:
|
|
12
|
+
|
|
13
|
+
After `json_matchers@0.9.x`, calls to `match_json_schema` and
|
|
14
|
+
`match_response_schema` will no longer accept options.
|
|
15
|
+
|
|
16
|
+
See https://github.com/thoughtbot/json_matchers/pull/31 for more information.
|
|
17
|
+
|
|
18
|
+
WARN
|
|
19
|
+
end
|
|
20
|
+
|
|
9
21
|
assertion = JsonMatchers::Assertion.new(schema_name.to_s, options)
|
|
10
22
|
|
|
11
23
|
match do |json|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: json_matchers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Doyle
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-04-
|
|
11
|
+
date: 2018-04-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json-schema
|