Method: Cucumber::FeatureFile#parse
- Defined in:
- lib/cucumber/feature_file.rb
#parse(configuration_filters, tag_counts) ⇒ Object
Parses a file and returns a Cucumber::Ast::Feature If configuration_filters
contains any filters, the result will be filtered.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cucumber/feature_file.rb', line 28 def parse(configuration_filters, tag_counts) filters = @lines || configuration_filters builder = Cucumber::Parser::GherkinBuilder.new(@path) filter_formatter = filters.empty? ? builder : Gherkin::Formatter::FilterFormatter.new(builder, filters) tag_count_formatter = Gherkin::Formatter::TagCountFormatter.new(filter_formatter, tag_counts) parser = Gherkin::Parser::Parser.new(tag_count_formatter, true, "root", false) begin parser.parse(source, @path, 0) builder.language = parser.i18n_language builder.result rescue Gherkin::Lexer::LexingError, Gherkin::Parser::ParseError => e e..insert(0, "#{@path}: ") raise e end end |