rspec-buildkite-analytics 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 1ca7801b3e7bc48f52a372df29c553c9e2dad5bffdab1bf8dff0b20f0173b987
4
- data.tar.gz: 22d6197b37f465afa1a2a309ba4f3780bafef928d626768a5d4d3fa6d214a809
3
+ metadata.gz: 541f8d1bf4465e411f3fa17757b1c13bc073ea361db1e66973060cb673779d39
4
+ data.tar.gz: 87bb5b43638e2db1951ab0fc0a60a67f5edc7f41c0b4d4735bf75d4202745d21
5
5
  SHA512:
6
- metadata.gz: '0380c462ae87c2dd2dbb830bbcdc93bef621b74f2f516c465b37e633679e9e0c887fe8557356aaf85abd8e7fe179110b86aabceb339057cd89e37c00afcac107'
7
- data.tar.gz: 9b6810ff8529454f543b70f521b34906223e2ee02ad1f0d4cd261d4bfe6e2c4ed21eb76c8eddfb08818c9c8a07d07cb62c3c206c958c48743a47c1dfde83f9b3
6
+ metadata.gz: e98d13112dddf07fbad1cef13042de7fadd856b3c92202859ebf7e9c935b72eb8d960525181c726fd2ac1d15f72e9252273c9c1e8553f466a0aa415e0307b7df
7
+ data.tar.gz: 9380dce5392e09ef0758780e8a58586f11aabc57ca11ea345d2ae3d7a0f9fa2bac1c982e514b0b556faddf10b0b5ba02f9495320a628bf7add4700898fb29d0e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-buildkite-analytics (0.6.0)
4
+ rspec-buildkite-analytics (0.6.1)
5
5
  activesupport (>= 5.2, <= 7.0)
6
6
  rspec-core (~> 3.10)
7
7
  rspec-expectations (~> 3.10)
@@ -53,10 +53,15 @@ module RSpec::Buildkite::Analytics
53
53
 
54
54
  private
55
55
 
56
+ MULTIPLE_ERRORS = [
57
+ RSpec::Expectations::MultipleExpectationsNotMetError,
58
+ RSpec::Core::MultipleExceptionError
59
+ ]
60
+
56
61
  def failure_info(notification)
57
62
  failure_expanded = []
58
63
 
59
- if notification.exception.class == RSpec::Expectations::MultipleExpectationsNotMetError
64
+ if RSpec::Buildkite::Analytics::Reporter::MULTIPLE_ERRORS.include?(notification.exception.class)
60
65
  failure_reason = notification.exception.summary
61
66
  notification.exception.all_exceptions.each do |exception|
62
67
  # an example with multiple failures doesn't give us a
@@ -71,10 +76,8 @@ module RSpec::Buildkite::Analytics
71
76
  }
72
77
  end
73
78
  else
74
- failure_reason = strip_diff_colors(notification.colorized_message_lines[0])
75
-
76
- # the second line is always whitespace padding
77
- message_lines = notification.colorized_message_lines[2..]
79
+ message_lines = notification.colorized_message_lines
80
+ failure_reason = strip_diff_colors(message_lines.shift)
78
81
 
79
82
  failure_expanded << {
80
83
  expanded: format_message_lines(message_lines),
@@ -87,6 +90,8 @@ module RSpec::Buildkite::Analytics
87
90
 
88
91
  def format_message_lines(message_lines)
89
92
  message_lines.map! { |l| strip_diff_colors(l) }
93
+ # the first line is sometimes blank, depending on the error reported
94
+ message_lines.shift if message_lines.first.blank?
90
95
  # the last line is sometimes blank, depending on the error reported
91
96
  message_lines.pop if message_lines.last.blank?
92
97
  message_lines
@@ -3,7 +3,7 @@
3
3
  module RSpec
4
4
  module Buildkite
5
5
  module Analytics
6
- VERSION = "0.6.0"
6
+ VERSION = "0.6.1"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-buildkite-analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buildkite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-08 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport