Class: AllureRspec::SuiteLabels
- Inherits:
-
Object
- Object
- AllureRspec::SuiteLabels
- Includes:
- Utils
- Defined in:
- lib/allure_rspec/suite_labels.rb
Overview
Suite label generator
Instance Method Summary collapse
-
#fetch ⇒ Array<Allure::Label>
Get test suite labels.
-
#initialize(example_group) ⇒ SuiteLabels
constructor
A new instance of SuiteLabels.
Methods included from Utils
Constructor Details
#initialize(example_group) ⇒ SuiteLabels
Returns a new instance of SuiteLabels.
9 10 11 |
# File 'lib/allure_rspec/suite_labels.rb', line 9 def initialize(example_group) @example_group = example_group end |
Instance Method Details
#fetch ⇒ Array<Allure::Label>
Get test suite labels
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/allure_rspec/suite_labels.rb', line 15 def fetch parents = example_group.parent_groups.map do |group| group.description.empty? ? "Anonymous" : group.description end labels = [] labels << Allure::ResultUtils.suite_label(suite(parents)) labels << Allure::ResultUtils.parent_suite_label(parent_suite(parents)) if parent_suite(parents) labels << Allure::ResultUtils.sub_suite_label(sub_suites(parents)) if sub_suites(parents) labels end |