Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noblesamurai/shallot

a lexer/parser for Gherkin
https://github.com/noblesamurai/shallot

Last synced: about 1 month ago
JSON representation

a lexer/parser for Gherkin

Awesome Lists containing this project

README

        

= shallot

shallot can lex and parse just enough Gherkin to give you:

{:feature=>"The name of the feature",
:background=>
[" Each step in the background",
" But without any additional parsing",
" Or validation",
""],
:scenarios=>
[{:name=>"And each scenario",
:outline=>false,
:tags=>["shallot", "regression", "bug"],
:contents=>
[" With tags, including those inherited",
" From the feature level tags",
""]},
{:name=>"As well as scenario outlines",
:outline=>true,
:tags=>["shallot", "feature"],
:contents=>
[" With support for the following",
" \"\"\"",
" long-quoted",
" sections",
" \"\"\"",
" While no extra for examples",
"",
" Examples:",
" | kind |",
" | parsing |",
" | lexing |"]}]}

The above results from calling Shallot.parse(f), where f is an open File
handle on the following feature file:

@shallot
Feature: The name of the feature
This gets completely ignored.

Background:
Each step in the background
But without any additional parsing
Or validation

@regression @bug
Scenario: And each scenario
With tags, including those inherited
From the feature level tags

@feature
Scenario Outline: As well as scenario outlines
With support for the following
"""
long-quoted
sections
"""
While no extra for examples

Examples:
| kind |
| parsing |
| lexing |

== Copyright

Copyright (c) 2011 Noble Samurai. See LICENSE.txt for
further details.