debug_exceptions_json 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: bfc043c13ee091fe6fa664fcf5df7b1e10f1b456
4
- data.tar.gz: bba57ccf2f471b9d30d473c58d96967dd5a2887c
3
+ metadata.gz: 0723497067fbb9817118efc91bc2cb0688789770
4
+ data.tar.gz: f16c308a1a26021c8ed65cb67a49327f95e24530
5
5
  SHA512:
6
- metadata.gz: 071d1c0211698b37c4d3dfede0350f89d51e6f1c9c1bab33c365006be4573faf252b1ff6d2599764dab2ac6c5d56e392595243328bf85d0c71cdb384e0178cf2
7
- data.tar.gz: bca9d8d69fc5e8433fcee0dc0e29f6c70ba48b904fa108dd5ee496b3570034c6d826c08054754bd54b893cb9c29982b5bb8f8203304b1f3406c4bdacb7eb1b43
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
@@ -1,3 +1,3 @@
1
1
  class DebugExceptionsJson
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debug_exceptions_json
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
  - Taiki Ono