json-schema-rspec 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: cf7ece58f4187556a3ef1ec8d53ba2154518a57b
4
- data.tar.gz: c05ef489dab2371dca40d13c4dba36cc623e2968
3
+ metadata.gz: 51323cef8057e8e33d6d54cf86a0e967180c1735
4
+ data.tar.gz: 77f09eb71673ceb8d39459b904aeade5b79faf9e
5
5
  SHA512:
6
- metadata.gz: 45bafafc48779ae37292c05209f497ce1be413acfac7888d9eb9b9b9918b89ef285a70450bd8de2c5bbc6cb691eba1f6a7a667b934a5a85c1efc2a9e7b633ca5
7
- data.tar.gz: 74dcb86009906ac8edc7fdd72248f9c64be523b9d2107285a1a2db89358cca74d0ba601dc63c75f923616a721d612783d1dbebaed5c7ed7fa025c7a73eab9128
6
+ metadata.gz: 5f7ff1b8e933d32c50202a3450720c1c9081c44c8c1af45e7caff212c4e1245847ae745cf3d0954443e5c4839b6c749462660384c101efbc0ddb48cdbb98bd74
7
+ data.tar.gz: 65b050448e92831c6f3408c8ca1a8c5cd1afc6bb831d873828ce70225c331b9d49509faecde311234547b929a779edfb7ec05b8a9ea7caafd9c5f728bd6b217e
@@ -1,3 +1,7 @@
1
+ 0.0.4 / 2015-12-29
2
+
3
+ * Generate proper description when there are no errors
4
+
1
5
  0.0.3 / 2015-09-14
2
6
  ==================
3
7
 
@@ -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 = [ "No schema defined for #{@schema_name}. Available schemas are #{RSpec.configuration.json_schemas.keys}." ]
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)
@@ -1,7 +1,7 @@
1
1
  module Json
2
2
  module Schema
3
3
  module Rspec
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
6
6
  end
7
7
  end
@@ -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.3
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-09-14 00:00:00.000000000 Z
12
+ date: 2015-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec