Class: FlavoredGherkin::Flavour

Inherits:
Object
  • Object
show all
Defined in:
lib/flavored_gherkin/flavour.rb

Overview

Base for Flavored Gherkin Flavours

Direct Known Subclasses

HtmlFlavour, PdfFlavour

Instance Method Summary collapse

Instance Method Details

#get_gherkins(feature_files) ⇒ Array

Parser Feature Files and Returns List of Gherkin Documents

Parameters:

  • feature_files (Array)

    List of feature files

Returns:

  • (Array)

    List of Gherkin Documents



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/flavored_gherkin/flavour.rb', line 15

def get_gherkins(feature_files)
  parser = Gherkin::Parser.new
  feature_files.map do |file|
    begin
      gherkin = parser.parse(File.read(file))
      gherkin[:file] = file
      gherkin
    rescue
      puts "Skipping:: Invalid gherkin feature file #{file}"
    end
  end
end