allure-ruby-commons 2.30.2 → 2.31.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: 492d75d28e533a935e38fd4684de66b9041a9d0e15e1fa6e63fbd25c38eaf231
4
- data.tar.gz: 7a6be418174a478614942fff81b7c305efa1b2f8074eb450c94ce8ec40869d07
3
+ metadata.gz: 6bb3d41a92d2a5f31e4a1e183324d39762a4b470c063e681487d5e3a25b1a43d
4
+ data.tar.gz: 94f52c299af1494c6e6c372f562a196ba7c9000cb489f9b7effea335c2f8e9e7
5
5
  SHA512:
6
- metadata.gz: c8c4a8ba69a1be3d0fb53848c0c38c9188b40516ab139ad6e8ffae7a58830908f6f413b5e9192aacce1b64697efa672979caaa3b941c8f6a4d24e46ccd6e821e
7
- data.tar.gz: fbd9d29cc963268f5809fbb99b1c2e574fbde2760d6180b484a0a22fb47888075d809d818616cc31b33a92598a364b4ebb0fe7ff257cb58439da5aab524a3403
6
+ metadata.gz: 456d7632df840169a22ad9f632646b31c6154a3c6840731acd7994353a4cecb7555d89e22cbe25e7fd83422eb60235db271f5b4ca9de425881b5ab1daf53c526
7
+ data.tar.gz: 3d80679f0439e64299f62948621db0931ddbc34125e59c47722d2891468ca4810c00f58df0422772857d0a9a13acbe8dd2bb72cadd70aa118a591ff2495b921a
@@ -12,12 +12,13 @@ module Allure
12
12
  # @option options [Boolean] :flaky
13
13
  # @option options [String] :message
14
14
  # @option options [String] :trace
15
- def initialize(timestamp:, **options)
15
+ def initialize(timestamp:, status: nil, **options)
16
16
  super(**options)
17
17
 
18
+ @status = status
18
19
  @timestamp = timestamp
19
20
  end
20
21
 
21
- attr_accessor :timestamp
22
+ attr_accessor :timestamp, :status
22
23
  end
23
24
  end
@@ -157,9 +157,13 @@ module Allure
157
157
 
158
158
  # Get exception status detail
159
159
  # @param [Exception] exception
160
+ # @param [Hash] options
161
+ # @option options [Boolean] :known
162
+ # @option options [Boolean] :muted
163
+ # @option options [Boolean] :flaky
160
164
  # @return [Allure::StatusDetails]
161
- def status_details(exception)
162
- StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join("\n"))
165
+ def status_details(exception, **options)
166
+ StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join("\n"), **options)
163
167
  end
164
168
 
165
169
  # Allure attachment object
@@ -190,15 +194,18 @@ module Allure
190
194
 
191
195
  # Allure global error object
192
196
  # @param [Number] timestamp
197
+ # @param [StandardError] :exception
193
198
  # @param [Hash] options
194
199
  # @option options [Boolean] :known
195
200
  # @option options [Boolean] :muted
196
201
  # @option options [Boolean] :flaky
197
- # @option options [String] :message
198
- # @option options [String] :trace
199
202
  # @return [Allure::GlobalError]
200
- def prepare_global_error(timestamp: self.timestamp, **options)
201
- GlobalError.new(timestamp: timestamp, **options)
203
+ def prepare_global_error(timestamp: self.timestamp, exception: nil, **options)
204
+ GlobalError.new(
205
+ timestamp: timestamp,
206
+ status: status(exception),
207
+ **status_details(exception, **options).to_hash.transform_keys(&:to_sym)
208
+ )
202
209
  end
203
210
 
204
211
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-ruby-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.30.2
4
+ version: 2.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis