allure-ruby-commons 2.23.0 → 2.24.3

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: 4b89403fa9ff123ca174b2cb549d44d1ae735525f6ead1381fbab1b9ac5bd2c3
4
- data.tar.gz: 744f94f9f132afb70ffb3c75f82a825cbca9f319fed84b0710de65831bae7a40
3
+ metadata.gz: 16773f1e99661e2e998ebc98e4b4e0eb314a8a587c98b97b619babb99dd8a69c
4
+ data.tar.gz: a59385cd57fc0889e8ea7e90c01018295aa7ea669b31dc6412ed6a5ca89973e4
5
5
  SHA512:
6
- metadata.gz: 8149ac31acb1a6da4766e4ef2ebc8e033ad5f5b73baf11328e5000c466a359fa7e95324ef0ca9c62f78e29968e5ff58aa408ce0e12568d9d15a5767bc2c951d4
7
- data.tar.gz: f2c920ca880c4f637f8f474cf957313aa6bfde473b245c9d1bbbb321c2625964bc6b7da24fee13d7af64dc207620313869daa3a742ca03d1d86de24cd0f88906
6
+ metadata.gz: 7c90862f0b9287e7519704487c218691a3149306755383a793d7a110e98d5c3ef540bd80eae7645a6b90f03242208c31053b1bef5b5ff9dc7fa8305f2e6d4ddf
7
+ data.tar.gz: 2b96ef3597432ecf88857cbd6b4d7fb8f35ad8e6590981fec7b9d7089e66989fae82670d4e73c91981bea4f6adbd86e76b88d68835275255ee11abb4e7e25b97
@@ -225,7 +225,7 @@ module Allure
225
225
  lifecycle.update_test_step { |step| step.status = Status::PASSED }
226
226
 
227
227
  result
228
- rescue StandardError, RSpec::Expectations::ExpectationNotMetError => e
228
+ rescue StandardError, configuration.failure_exception => e
229
229
  lifecycle.update_test_step do |step|
230
230
  step.status = ResultUtils.status(e)
231
231
  step.status_details = ResultUtils.status_details(e)
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "logger"
4
4
  require "singleton"
5
+ require "rspec/expectations"
5
6
 
6
7
  module Allure
7
8
  # Allure configuration class
@@ -11,7 +12,7 @@ module Allure
11
12
  # @return [Array<String>] valid log levels
12
13
  LOGLEVELS = %w[DEBUG INFO WARN ERROR FATAL UNKNOWN].freeze
13
14
 
14
- attr_writer :environment, :logger
15
+ attr_writer :environment, :logger, :failure_exception
15
16
 
16
17
  attr_accessor :results_directory,
17
18
  :logging_level,
@@ -41,5 +42,12 @@ module Allure
41
42
  def logger
42
43
  @logger ||= Logger.new($stdout, level: logging_level)
43
44
  end
45
+
46
+ # Exception class that corresponds to test failure
47
+ #
48
+ # @return [Class]
49
+ def failure_exception
50
+ @failure_exception ||= RSpec::Expectations::ExpectationNotMetError
51
+ end
44
52
  end
45
53
  end
@@ -152,14 +152,14 @@ module Allure
152
152
  # @param [Exception] exception
153
153
  # @return [Symbol]
154
154
  def status(exception)
155
- exception.is_a?(RSpec::Expectations::ExpectationNotMetError) ? Status::FAILED : Status::BROKEN
155
+ exception.is_a?(Allure.configuration.failure_exception) ? Status::FAILED : Status::BROKEN
156
156
  end
157
157
 
158
158
  # Get exception status detail
159
159
  # @param [Exception] exception
160
160
  # @return [Allure::StatusDetails]
161
161
  def status_details(exception)
162
- StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join("\n"))
162
+ StatusDetails.new(message: exception&.message || exception.class.name, trace: exception&.backtrace&.join("\n"))
163
163
  end
164
164
 
165
165
  # Allure attachment object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-ruby-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.23.0
4
+ version: 2.24.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2024-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.4.10
143
+ rubygems_version: 3.5.3
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Common library for allure results generation