Class: ParallelTests::Cucumber::Scenarios

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_tests/cucumber/scenarios.rb

Class Method Summary collapse

Class Method Details

.all(files, options = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/parallel_tests/cucumber/scenarios.rb', line 19

def all(files, options = {})
  # Parse tag expression from given test options and ignore tag pattern. Refer here to understand how new tag expression syntax works - https://github.com/cucumber/cucumber/tree/master/tag-expressions
  tags = []
  words = options[:test_options] || []
  words.each_with_index { |w, i| tags << words[i + 1] if ["-t", "--tags"].include?(w) }
  if ignore = options[:ignore_tag_pattern]
    tags << "not (#{ignore})"
  end
  tags_exp = tags.compact.join(" and ")

  split_into_scenarios files, tags_exp
end