debug_exceptions_json 0.2.1 → 0.2.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: 0723497067fbb9817118efc91bc2cb0688789770
|
4
|
+
data.tar.gz: f16c308a1a26021c8ed65cb67a49327f95e24530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6676b0451ee45342c05c502780da60a900eaadcf5f8823da81155e83ab858fbfe5bf8f552ba26a704bdd5f64d1be7b26d8926c6a824fed479451e699e2b4b0e2
|
7
|
+
data.tar.gz: 927c54ff4c439878e96742011e8a627bec2cd02f0b051af191d4efc8f37450635217ba1dcbed2245fa70f0e3e5428fa7139ef2cbb2b8909ff2ee30d858e4c53f
|
@@ -31,7 +31,7 @@ class DebugExceptionsJson
|
|
31
31
|
formatted << failure.fully_formatted(index.next, colorizer)
|
32
32
|
response = failure.example.metadata[:response]
|
33
33
|
|
34
|
-
if response.server_error?
|
34
|
+
if response && response.server_error?
|
35
35
|
begin
|
36
36
|
e = JSON(response.body)['error']
|
37
37
|
rescue JSON::ParserError
|
@@ -49,6 +49,7 @@ class DebugExceptionsJson
|
|
49
49
|
|
50
50
|
def dump_failures_2
|
51
51
|
return if failed_examples.empty?
|
52
|
+
|
52
53
|
output.puts
|
53
54
|
output.puts "Failures:"
|
54
55
|
failed_examples.each_with_index do |example, index|
|
@@ -58,7 +59,7 @@ class DebugExceptionsJson
|
|
58
59
|
|
59
60
|
response = example.metadata[:response]
|
60
61
|
|
61
|
-
if response.server_error?
|
62
|
+
if response && response.server_error?
|
62
63
|
begin
|
63
64
|
e = JSON(response.body)['error']
|
64
65
|
rescue JSON::ParserError
|
@@ -6,11 +6,11 @@ class DebugExceptionsJson
|
|
6
6
|
after do |example|
|
7
7
|
# For RSpec2 compatibility
|
8
8
|
if ::RSpec::Core::Version::STRING.split('.').first == "3"
|
9
|
-
example.metadata[:response] = example.instance_exec { response }
|
9
|
+
example.metadata[:response] = example.instance_exec { respond_to?(:response) && response }
|
10
10
|
else
|
11
11
|
# RSpec2 passes ExampleGroup::Nested_N
|
12
12
|
nested = example
|
13
|
-
nested.example.metadata[:response] = nested.example.instance_eval { response }
|
13
|
+
nested.example.metadata[:response] = nested.example.instance_eval { respond_to?(:response) && response }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|