allure-ruby-commons 2.22.0 → 2.24.0

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: '099ba3dddaa422aadd6805174b9ea6355be15b89b0587baf39d379dfda0763ad'
4
- data.tar.gz: 066eb591f740c700e09f712b86b83c28bac6fd903321d8643426872a0ba61bbe
3
+ metadata.gz: 6f34cbec5024dd0f9020ad754d864ae81e40b0e897a22e82877f449e5e1b1b4a
4
+ data.tar.gz: f5548e03201fe7914afa867a7c120d8ac7cd4f5848b8235e50c34947c5ff0dfe
5
5
  SHA512:
6
- metadata.gz: c6f36b3ecdc794f0ddb952e125a9cd55600763478038dd7634ff40e7131f75f246a726bf189871f6581a4a051b5c095b605ffcc464389dcb8538eed5bcdf3cf5
7
- data.tar.gz: 94efb6010db9cbca76f4136567a6c4330108ec6b2d140f36d007dcb5c64ae53fd5ed4dd05cb7184119af04d894f4eea1f5da78238bf7377c823e947d614edd56
6
+ metadata.gz: ec356f8eeff13aa542a4c6c973ffd550dd1869bc42513f3ccaa3101fa92beeb57204675d1333893615385be54043405e72f05b94c619ae1c0ab170f57de5c34e
7
+ data.tar.gz: 969662fc973786ed5531da7ecf176c0628eccc4855adcb74a526876099f79e5073f82b9d92d220f6d13c00d252e558184726a13f4945711bba87980591a6ae28
@@ -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,7 +152,7 @@ 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
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.22.0
4
+ version: 2.24.0
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-06-27 00:00:00.000000000 Z
11
+ date: 2024-02-17 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