class Cukedep::GherkinListener

A ParserListener listens to all the formatting events emitted by the Gherkin parser. It converts the received the feature file elements and builds a representation of the feature files that is appropriate for the Cukedep application.

Attributes

current_feature[RW]

Internal representation of the feature being parsed

feature_files[R]

The list of feature files encountered so far

Public Class Methods

new() click to toggle source

Constructor

# File lib/cukedep/gherkin-listener.rb, line 33
def initialize
  @feature_files = []
end

Public Instance Methods

feature_tags(tag_names) click to toggle source

aFeature is a Gherkin::Formatter::Model::Feature instance

# File lib/cukedep/gherkin-listener.rb, line 49
def feature_tags(tag_names)
  @current_feature = feature_files.last.feature = FeatureRep.new(tag_names)
end
method_missing(message, *args) click to toggle source

Catch all method

Calls superclass method
# File lib/cukedep/gherkin-listener.rb, line 54
def method_missing(message, *args)
  puts caller(1, 5).join("\n")
  puts "Method #{message} is not implemented (yet)."
  super(message, args)
end
uri(featureURI) click to toggle source

Called when beginning the parsing of a feature file. featureURI: path + filename of feature file.

# File lib/cukedep/gherkin-listener.rb, line 43
def uri(featureURI)
  new_file = FeatureFileRep.new(featureURI)
  feature_files << new_file
end