Class: Turnip::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/turnip/builder.rb

Class Method Summary collapse

Class Method Details

.build(feature_file) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/turnip/builder.rb', line 6

def self.build(feature_file)
  messages = Gherkin.from_paths(
    [feature_file],
    include_source: false,
    include_gherkin_document: true,
    include_pickles: false
  )
  result = messages.first&.gherkin_document&.to_hash

  return nil if result.nil? || result[:feature].nil?
  Node::Feature.new(result[:feature])
end