blackbriar 0.0.4 → 0.0.5

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: 7365bf06ad8930316900235ff8358b91695bc010
4
- data.tar.gz: eb4b9a3689a3987cd2992df1b6357c179ea2ff4c
3
+ metadata.gz: 22336dec55c98d30f682bf99868af2a93fee586a
4
+ data.tar.gz: cdac3a7c147f074eef110ab67555391bf4ff9516
5
5
  SHA512:
6
- metadata.gz: dc64b13e4300e7e83d0b0cb4e8ae7f16e245620c6d8cd2b9ed460f4929d3eae6c2bd7cf96e33892e1648e156fc39c5ef9a6cd983620e275a6030c0f51c4e3d8c
7
- data.tar.gz: 5a378970d9a5a3836f23c5ab069af0d3675de3476921c85d73b60e31092c926260b0d4254d19fb6407bab20f3c39b74ad313ff5054a899d48b354ebc3c1c2c85
6
+ metadata.gz: 801f282dec5aa0e62513df127a8759bda0e3550fb88b49af247ee88deb7f72b93084e62f9bdf79fae4572b1885f3032a32553e28f1a4d8cbca013c8dc3ff8ed5
7
+ data.tar.gz: 35a55638cdbee920f84135d371937e9e16583ec5259c215db8c2dad53aa75cb75a354f594b423e02af1b6d7f5fc39cb1dcde1ef95e554409e759e719c7d3d943
@@ -29,7 +29,18 @@ RSpec::Matchers.define :match_yaml_schema do |schema|
29
29
  end
30
30
 
31
31
  failure_message do
32
- @errors
32
+ %Q{
33
+ Expected:
34
+
35
+ #{actual.to_s.truncate(250, omission: "...")},
36
+
37
+ to match schema:
38
+
39
+ #{schema}
40
+
41
+ Errors:
42
+ #{@errors}
43
+ }
33
44
  end
34
45
  end
35
46
 
@@ -67,7 +78,18 @@ RSpec::Matchers.define :match_json_schema do |schema|
67
78
  end
68
79
 
69
80
  failure_message do
70
- @errors
81
+ %Q{
82
+ Expected:
83
+
84
+ #{actual.to_s.truncate(250, omission: "...")},
85
+
86
+ to match schema:
87
+
88
+ #{schema}
89
+
90
+ Errors:
91
+ #{@errors}
92
+ }
71
93
  end
72
94
  end
73
95
 
@@ -106,3 +128,14 @@ RSpec::Matchers.define :not_have_errors_at do |map|
106
128
  expect(value).to not_match_json_schema error_schema
107
129
  end
108
130
  end
131
+
132
+ RSpec::Matchers.define :have_value_at do |json_path|
133
+ match do |actual|
134
+ expected_value = json_path_value(json_path)
135
+ expected_value.present?
136
+ end
137
+
138
+ define_method :json_path_value do |json_path|
139
+ @value = Blackbriar::ValueProvider.new(actual).resolve(json_path)
140
+ end
141
+ end
@@ -1,3 +1,3 @@
1
1
  module Blackbriar
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blackbriar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyrone Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_schema