class ManiokBdd::GherkinFormatter

Public Class Methods

build(feature_file) click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 5
def self.build(feature_file)
  new.tap do |gherkin_formatter|
    parser = Gherkin::Parser::Parser.new(gherkin_formatter, true)
    parser.parse(File.read(feature_file), feature_file, 0)
  end
end

Public Instance Methods

eof() click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 32
def eof
end
feature(gherkin_model_feature) click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 16
def feature(gherkin_model_feature)
  @feature = Feature.new gherkin_model_feature
end
scenario(gherkin_model_scenario) click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 20
def scenario(gherkin_model_scenario)
  @feature.scenarios << (@current_scenario = Scenario.new(gherkin_model_scenario))
end
step(gherkin_model_step) click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 24
def step(gherkin_model_step)
  @current_scenario.steps << Step.new(gherkin_model_step)
end
to_s() click to toggle source
# File lib/maniok_bdd/gherkin_formatter.rb, line 12
def to_s
  @feature.to_s
end
uri(*) click to toggle source

to avoid undefined method `uri' & efo and keep Gherkin parser happy

# File lib/maniok_bdd/gherkin_formatter.rb, line 29
def uri(*)
end