Class: ParallelTests::Cucumber::Formatters::ScenarioLineLogger
- Inherits:
-
Object
- Object
- ParallelTests::Cucumber::Formatters::ScenarioLineLogger
- Defined in:
- lib/parallel_tests/cucumber/scenario_line_logger.rb
Instance Attribute Summary collapse
-
#scenarios ⇒ Object
readonly
Returns the value of attribute scenarios.
Instance Method Summary collapse
-
#initialize(tag_expression = nil) ⇒ ScenarioLineLogger
constructor
A new instance of ScenarioLineLogger.
-
#method_missing ⇒ Object
# rubocop:disable Style/MissingRespondToMissing.
- #visit_feature_element(uri, feature_element, feature_tags, line_numbers: []) ⇒ Object
Constructor Details
#initialize(tag_expression = nil) ⇒ ScenarioLineLogger
Returns a new instance of ScenarioLineLogger.
8 9 10 11 |
# File 'lib/parallel_tests/cucumber/scenario_line_logger.rb', line 8 def initialize(tag_expression = nil) @scenarios = [] @tag_expression = tag_expression end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
# rubocop:disable Style/MissingRespondToMissing
40 |
# File 'lib/parallel_tests/cucumber/scenario_line_logger.rb', line 40 def method_missing(*); end |
Instance Attribute Details
#scenarios ⇒ Object (readonly)
Returns the value of attribute scenarios.
6 7 8 |
# File 'lib/parallel_tests/cucumber/scenario_line_logger.rb', line 6 def scenarios @scenarios end |
Instance Method Details
#visit_feature_element(uri, feature_element, feature_tags, line_numbers: []) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/parallel_tests/cucumber/scenario_line_logger.rb', line 13 def visit_feature_element(uri, feature_element, , line_numbers: []) = feature_element..map(&:name) = + if feature_element.is_a?(CukeModeler::Scenario) # :Scenario test_line = feature_element.source_line # We don't accept the feature_element if the current tags are not valid return unless () # or if it is not at the correct location return if line_numbers.any? && !line_numbers.include?(test_line) @scenarios << [uri, feature_element.source_line].join(":") else # :ScenarioOutline feature_element.examples.each do |example| = example..map(&:name) = + next unless () example.rows[1..].each do |row| test_line = row.source_line next if line_numbers.any? && !line_numbers.include?(test_line) @scenarios << [uri, test_line].join(':') end end end end |