allure-ruby-commons 2.23.0 → 2.24.0

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
  SHA256:
3
- metadata.gz: 4b89403fa9ff123ca174b2cb549d44d1ae735525f6ead1381fbab1b9ac5bd2c3
4
- data.tar.gz: 744f94f9f132afb70ffb3c75f82a825cbca9f319fed84b0710de65831bae7a40
3
+ metadata.gz: 6f34cbec5024dd0f9020ad754d864ae81e40b0e897a22e82877f449e5e1b1b4a
4
+ data.tar.gz: f5548e03201fe7914afa867a7c120d8ac7cd4f5848b8235e50c34947c5ff0dfe
5
5
  SHA512:
6
- metadata.gz: 8149ac31acb1a6da4766e4ef2ebc8e033ad5f5b73baf11328e5000c466a359fa7e95324ef0ca9c62f78e29968e5ff58aa408ce0e12568d9d15a5767bc2c951d4
7
- data.tar.gz: f2c920ca880c4f637f8f474cf957313aa6bfde473b245c9d1bbbb321c2625964bc6b7da24fee13d7af64dc207620313869daa3a742ca03d1d86de24cd0f88906
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.23.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-09-06 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