Class: Kymera::Cucumber::TestParser

Inherits:
Object
  • Object
show all
Defined in:
lib/kymera/cucumber/test_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(tests, options) ⇒ TestParser

Returns a new instance of TestParser.



8
9
10
11
# File 'lib/kymera/cucumber/test_parser.rb', line 8

def initialize(tests, options)
  @tests = tests
  @options = options
end

Instance Method Details

#parse_testsObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kymera/cucumber/test_parser.rb', line 13

def parse_tests
  tests = dry_run(["cucumber", @tests, '--dry-run -f DryRunFormatter', @options].compact.join(" ")).split("\n")
  refined_tests =[]
  tests.delete_at(0) if tests[0].downcase.include?('using')
  tests.each do |test|
    refined_tests << test.gsub('\\','/')
  end
  $stdout << "The number of scenarios found to be executed: #{refined_tests.count}"
  $stdout << "\n"
  refined_tests
end