committee 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ module Committee
17
17
  end
18
18
 
19
19
  if !@validator.validate(data)
20
- errors = error_messages(@validator.errors).join("\n")
20
+ errors = JsonSchema::SchemaError.aggregate(@validator.errors).join("\n")
21
21
  raise InvalidResponse, "Invalid response.\n\n#{errors}"
22
22
  end
23
23
  end
@@ -30,15 +30,5 @@ module Committee
30
30
  %{"Content-Type" response header must be set to "application/json".}
31
31
  end
32
32
  end
33
-
34
- def error_messages(errors)
35
- errors.map do |error|
36
- if error.schema
37
- %{At "#{error.schema.uri}": #{error.message}}
38
- else
39
- error.message
40
- end
41
- end
42
- end
43
33
  end
44
34
  end
@@ -43,7 +43,7 @@ describe Committee::ResponseValidator do
43
43
  it "raises errors generated by json_schema" do
44
44
  @data.merge!("name" => "%@!")
45
45
  e = assert_raises(Committee::InvalidResponse) { call }
46
- message = %{Invalid response.\n\nAt "/schema/app": Expected string to match pattern "/^[a-z][a-z0-9-]{3,30}$/", value was: %@!.}
46
+ message = %{Invalid response.\n\n#/name: failed schema #/properties/app/properties/name: Expected string to match pattern "/^[a-z][a-z0-9-]{3,30}$/", value was: %@!.}
47
47
  assert_equal message, e.message
48
48
  end
49
49
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: committee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,24 +10,24 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-21 00:00:00.000000000 Z
13
+ date: 2014-05-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json_schema
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
- - - ! '>'
20
+ - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: '0.0'
22
+ version: 0.0.13
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ! '>'
28
+ - - ~>
29
29
  - !ruby/object:Gem::Version
30
- version: '0.0'
30
+ version: 0.0.13
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: multi_json
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -60,38 +60,6 @@ dependencies:
60
60
  - - ! '>'
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0.0'
63
- - !ruby/object:Gem::Dependency
64
- name: rack-test
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- - !ruby/object:Gem::Dependency
80
- name: rr
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ! '>='
85
- - !ruby/object:Gem::Version
86
- version: '0'
87
- type: :development
88
- prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ! '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
63
  description:
96
64
  email:
97
65
  - brandur@mutelight.org