allure-ruby-commons 2.23.0 → 2.24.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: 4b89403fa9ff123ca174b2cb549d44d1ae735525f6ead1381fbab1b9ac5bd2c3
4
- data.tar.gz: 744f94f9f132afb70ffb3c75f82a825cbca9f319fed84b0710de65831bae7a40
3
+ metadata.gz: 4e1867060f57c0e7c6d930406f3468e5f5740a222d50b0ae3e1eb660a12cfdff
4
+ data.tar.gz: 17cd54f4433729deb2532730b447875a26fe67c887ee4f4603e235f3b486b337
5
5
  SHA512:
6
- metadata.gz: 8149ac31acb1a6da4766e4ef2ebc8e033ad5f5b73baf11328e5000c466a359fa7e95324ef0ca9c62f78e29968e5ff58aa408ce0e12568d9d15a5767bc2c951d4
7
- data.tar.gz: f2c920ca880c4f637f8f474cf957313aa6bfde473b245c9d1bbbb321c2625964bc6b7da24fee13d7af64dc207620313869daa3a742ca03d1d86de24cd0f88906
6
+ metadata.gz: ce79bd94f4dfbda6be85cce17845908fc820ba9cf82d4c3d216ce613729199b19fadf510da87d0e114c28dcc25efb4cd4dd52fa81f7bce51830d4aa618cc7180
7
+ data.tar.gz: 337bf3d1a51ce254d2a9c64cea09e79e568c5e8c7afce88279e84ab9408ca413b08bae805a1857d643dc9aed4fb4a53f2b1478b5fb379104c54c368a47016894
@@ -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.1
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-26 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