allure-rspec 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 +4 -4
- data/README.md +12 -0
- data/lib/allure_rspec/config.rb +8 -21
- data/lib/allure_rspec/metadata_parser.rb +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54acf3d26cd69ca771c6b7a900f8607d61bb302018a52797125736fa450b494
|
4
|
+
data.tar.gz: 0a8d23d328febe3ce16a636462bc4b859f2496e3dffc8156508317211f7a1716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be86fc5e45289c4a0e3eb9ec2c8b7d0e4babbfb32c8a6cd72f206af7a0a18bdf0e56f648f659bfa3120f482131277ff5ffae6556aea89f5cf49ef32227acf0f
|
7
|
+
data.tar.gz: 7553fc7de076d668537881ac3e85cc6312743f9f40284700e85f004f7f2940c833684edf0adb689c45bad956fdc564b384e905eddcb1cc26b1a422031d7037d8
|
data/README.md
CHANGED
@@ -207,6 +207,18 @@ it "some test case 2", story: "user story" do
|
|
207
207
|
end
|
208
208
|
```
|
209
209
|
|
210
|
+
### Custom failure exception
|
211
|
+
|
212
|
+
Allure report will mark steps and tests as either `Failed` or `Broken` based on exception class that was raised. By default, `RSpec::Expectations::ExpectationNotMetError` exception will mark test as `Failed` and all other exceptions will mark test as `Broken`.
|
213
|
+
|
214
|
+
Custom failure exception class can be configured:
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
AllureRspec.configure do |config|
|
218
|
+
config.failure_exception = MyCustomFailedException
|
219
|
+
end
|
220
|
+
```
|
221
|
+
|
210
222
|
### Custom actions
|
211
223
|
|
212
224
|
Rspec example object has access to [Allure](https://www.rubydoc.info/github/allure-framework/allure-ruby/Allure) helper methods.
|
data/lib/allure_rspec/config.rb
CHANGED
@@ -21,7 +21,6 @@ module AllureRspec
|
|
21
21
|
# @return [String]
|
22
22
|
class RspecConfig
|
23
23
|
include Singleton
|
24
|
-
extend Forwardable
|
25
24
|
|
26
25
|
# @return [Symbol] default tms tag
|
27
26
|
DEFAULT_TMS_TAG = :tms
|
@@ -36,26 +35,6 @@ module AllureRspec
|
|
36
35
|
# @return [Symbol] default story tag
|
37
36
|
DEFAULT_STORY_TAG = :story
|
38
37
|
|
39
|
-
def_delegators :@allure_config,
|
40
|
-
:clean_results_directory,
|
41
|
-
:clean_results_directory=,
|
42
|
-
:link_issue_pattern,
|
43
|
-
:link_issue_pattern=,
|
44
|
-
:link_tms_pattern,
|
45
|
-
:link_tms_pattern=,
|
46
|
-
:logging_level,
|
47
|
-
:logging_level=,
|
48
|
-
:logger,
|
49
|
-
:logger=,
|
50
|
-
:results_directory,
|
51
|
-
:results_directory=,
|
52
|
-
:environment,
|
53
|
-
:environment=,
|
54
|
-
:environment_properties,
|
55
|
-
:environment_properties=,
|
56
|
-
:categories,
|
57
|
-
:categories=
|
58
|
-
|
59
38
|
def initialize
|
60
39
|
@allure_config = Allure.configuration
|
61
40
|
end
|
@@ -102,5 +81,13 @@ module AllureRspec
|
|
102
81
|
def ignored_tags
|
103
82
|
@ignored_tags || []
|
104
83
|
end
|
84
|
+
|
85
|
+
def method_missing(method, ...)
|
86
|
+
@allure_config.respond_to?(method) ? @allure_config.send(method, ...) : super
|
87
|
+
end
|
88
|
+
|
89
|
+
def respond_to_missing?(method, include_private = false)
|
90
|
+
@allure_config.respond_to?(method, include_private) || super
|
91
|
+
end
|
105
92
|
end
|
106
93
|
end
|
@@ -143,12 +143,12 @@ module AllureRspec
|
|
143
143
|
# @param [Symbol] type
|
144
144
|
# @return [Array<Allure::Link>]
|
145
145
|
def matching_links(type)
|
146
|
-
link_pattern = config.public_send("link_#{type}_pattern")
|
146
|
+
link_pattern = config.public_send(:"link_#{type}_pattern")
|
147
147
|
return [] unless link_pattern
|
148
148
|
|
149
149
|
metadata
|
150
|
-
.select { |key| __send__("#{type}?", key) }
|
151
|
-
.map { |key, value| Allure::ResultUtils.public_send("#{type}_link", key.to_s, value, link_pattern) }
|
150
|
+
.select { |key| __send__(:"#{type}?", key) }
|
151
|
+
.map { |key, value| Allure::ResultUtils.public_send(:"#{type}_link", key.to_s, value, link_pattern) }
|
152
152
|
end
|
153
153
|
|
154
154
|
# Label value from custom metadata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
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:
|
11
|
+
date: 2024-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: allure-ruby-commons
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.24.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.24.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
85
|
+
rubygems_version: 3.5.3
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Allure rspec ruby adaptor
|