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 +4 -4
- data/lib/blackbriar/rspec/matchers.rb +35 -2
- data/lib/blackbriar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22336dec55c98d30f682bf99868af2a93fee586a
|
4
|
+
data.tar.gz: cdac3a7c147f074eef110ab67555391bf4ff9516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
data/lib/blackbriar/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_schema
|