json-schema-rspec 0.0.3 → 0.0.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51323cef8057e8e33d6d54cf86a0e967180c1735
|
4
|
+
data.tar.gz: 77f09eb71673ceb8d39459b904aeade5b79faf9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f7ff1b8e933d32c50202a3450720c1c9081c44c8c1af45e7caff212c4e1245847ae745cf3d0954443e5c4839b6c749462660384c101efbc0ddb48cdbb98bd74
|
7
|
+
data.tar.gz: 65b050448e92831c6f3408c8ca1a8c5cd1afc6bb831d873828ce70225c331b9d49509faecde311234547b929a779edfb7ec05b8a9ea7caafd9c5f728bd6b217e
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,7 @@ module JSON
|
|
11
11
|
def initialize(schema_name, validation_opts = {})
|
12
12
|
@schema_name = schema_name
|
13
13
|
@validation_opts = validation_opts
|
14
|
+
@errors = []
|
14
15
|
end
|
15
16
|
|
16
17
|
def matches?(actual)
|
@@ -18,7 +19,7 @@ module JSON
|
|
18
19
|
|
19
20
|
schema = schema_for_name(@schema_name)
|
20
21
|
if schema.nil?
|
21
|
-
@errors = [
|
22
|
+
@errors = ["No schema defined for #{@schema_name}. Available schemas are #{RSpec.configuration.json_schemas.keys}."]
|
22
23
|
return false
|
23
24
|
end
|
24
25
|
@errors = JSON::Validator.fully_validate(schema_for_name(@schema_name), @actual, @validation_opts)
|
@@ -97,6 +97,11 @@ describe JSON::SchemaMatchers::MatchJsonSchemaMatcher do
|
|
97
97
|
specify 'when tested against valid json' do
|
98
98
|
expect(valid_json).to match_json_schema(:inline_schema)
|
99
99
|
end
|
100
|
+
|
101
|
+
specify 'assigns a valid description' do
|
102
|
+
matcher = match_json_schema(:inline_schema)
|
103
|
+
expect(matcher.description).to eq("match JSON schema identified by #{:inline_schema}")
|
104
|
+
end
|
100
105
|
end
|
101
106
|
|
102
107
|
context 'does not find a match' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-schema-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharethrough Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|