A Gherkin lexer/parser.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Yuki Izumi f05edf1bf8 Regenerate gemspec for version 0.4 6 years ago
lib Names. 6 years ago
test Include comments and newlines; necessary to do line-by-line matching to original features. 0.3 8 years ago
.document Starting to make this into a gem. 8 years ago
.gitignore Starting to make this into a gem. 8 years ago
COPYING Add GPLv3 9 years ago
Gemfile Names. 6 years ago
LICENSE.txt Starting to make this into a gem. 8 years ago
README.rdoc Updating the documentation to reflect the inclusion of newlines. 8 years ago
Rakefile Names. 6 years ago
shallot.gemspec Regenerate gemspec for version 0.4 6 years ago

README.rdoc

= 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 <kind> 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 <kind> for examples

Examples:
| kind |
| parsing |
| lexing |

== Copyright

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