json-matchers 0.2.1 → 0.2.2

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: c9048f09839b73e0b2ef1461eb3077d829c335d8
4
- data.tar.gz: 96ab891eccffcf3293154903283936f73c88f298
3
+ metadata.gz: 3eb4da42712b9d05834e8600bbae9834c1f306ae
4
+ data.tar.gz: 247f1f80aad4fe545c6437c6b08a69dbd47a176b
5
5
  SHA512:
6
- metadata.gz: 11cc50e1c986410140ae805bb20507aeba25b287bd52ce4092168e72a49928c3057c8a91815b50df0220d198b9d03b988f5f73dba049e746071049d95cb85fe0
7
- data.tar.gz: 6ec6a54588124cbdeacd5e4ea86ff272a77c25f3fae71313fd58f8472f2693e29b00232cafc471fcc014cb0e97384f777561efe47108727abd7dd65f0e132e82
6
+ metadata.gz: 1986b67043756ddbae800c9e6f6b593461bd8a32000cc2ac5091eaba72c8f77d0ee46d5d3554c4db7975ff9b8b952864811f0f828a7224d93398edfa599ae0ec
7
+ data.tar.gz: a418df00dd43112eceefceff27e35367daba2bba642318a8696c428d124722aeaa2bd45800e323e44e45fdd55297b8e09d57a9f305f0cc5e1e28938e707b0cc1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  master
2
2
  ------
3
3
 
4
+ 0.2.2
5
+ -----
6
+
7
+ * Includes validation failure message in RSpec output
8
+
4
9
  0.2.1
5
10
  -----
6
11
 
@@ -7,11 +7,16 @@ module JSON
7
7
  @response = response
8
8
 
9
9
  JSON::Validator.validate!(schema_path.to_s, response.body, strict: true)
10
- rescue JSON::Schema::ValidationError
10
+ rescue JSON::Schema::ValidationError => ex
11
+ @validation_failure_message = ex.message
11
12
  false
12
13
  rescue JSON::ParserError
13
14
  raise InvalidSchemaError
14
15
  end
16
+
17
+ def validation_failure_message
18
+ @validation_failure_message.to_s
19
+ end
15
20
  end
16
21
  end
17
22
  end
@@ -18,6 +18,11 @@ module JSON
18
18
  to match schema "#{schema_name}":
19
19
 
20
20
  #{schema_body}
21
+
22
+ ---
23
+
24
+ #{validation_failure_message}
25
+
21
26
  FAIL
22
27
  end
23
28
 
@@ -30,6 +35,11 @@ module JSON
30
35
  not to match schema "#{schema_name}":
31
36
 
32
37
  #{schema_body}
38
+
39
+ ---
40
+
41
+ #{validation_failure_message}
42
+
33
43
  FAIL
34
44
  end
35
45
 
@@ -1,5 +1,5 @@
1
1
  module JSON
2
2
  module Matchers
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Doyle