rspec-raml 0.1.1 → 0.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ba735f8794e66e94088432feccc98f1862bbb43
|
4
|
+
data.tar.gz: e9865f89a7be1a54e3204af11e723a518b6569d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f149720d4648d75f0e719594a6ac6ebb2e25cf347531e49ddc1e64eef3b632fb013995bb9547180f29585d5d9e45847492bbaae9de0aaa5a3788246fb8db9a68
|
7
|
+
data.tar.gz: b0b14b47bdcaa2d7fa74540be7e7e1351198a40f660866629a39ec15f5f62a4b2b298e367f978aa9d9674dce03a3ca13e6e3c3f3f0f0d544767ec929b7dd2251
|
@@ -5,7 +5,11 @@ module RSpec
|
|
5
5
|
module Matchers
|
6
6
|
class MatchRamlBody < Abstract
|
7
7
|
def failure_message
|
8
|
-
diff = differ.
|
8
|
+
diff = differ.diff_as_object(
|
9
|
+
response_body,
|
10
|
+
raml_body
|
11
|
+
)
|
12
|
+
|
9
13
|
"expected response bodies to match:#{diff}"
|
10
14
|
end
|
11
15
|
|
@@ -20,20 +24,16 @@ module RSpec
|
|
20
24
|
end
|
21
25
|
|
22
26
|
def response_body
|
23
|
-
@response_body ||=
|
27
|
+
@response_body ||= JSON.parse(response.body)
|
24
28
|
end
|
25
29
|
|
26
30
|
def raml_body
|
27
|
-
@raml_body ||=
|
31
|
+
@raml_body ||= JSON.parse(raml.bodies.fetch(content_type).example)
|
28
32
|
end
|
29
33
|
|
30
34
|
def differ
|
31
35
|
@differ ||= RSpec::Support::Differ.new(color: true)
|
32
36
|
end
|
33
|
-
|
34
|
-
def indent_pretty_format(body)
|
35
|
-
pretty_format(body).gsub("\n", "\n ").prepend(' ')
|
36
|
-
end
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/lib/rspec/raml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-raml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Zane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: raml_ruby
|