Skip to content

Instantly share code, notes, and snippets.

@ghnatiuk
Created December 9, 2009 22:08
Show Gist options
  • Save ghnatiuk/252883 to your computer and use it in GitHub Desktop.
Save ghnatiuk/252883 to your computer and use it in GitHub Desktop.
Formatter events? Nested for viewing pleasure.
What else does a formatter need to know?
feature(name, line, file, language, etc...)
scenario(keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
scenario_end(result)
feature_end(result)
feature(name, line, file, language, etc..)
background(keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
background_end(result)
scenario_outline(keyword, name, line)
examples(keyword, name, line)
example(keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
example_end(result)
examples_end(result)
scenario_outline_end(result)
background(keyword, name, line) #same background as before
step(result, keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
background_end(result)
scenario(keyword, name, line)
step(result, keyword, name, line)
step(result, keyword, name, line)
scenario_end(result)
feature_end(result)
.
.
.
Maybe crazy idea: have gherkin send these same events (with empty results), allow multiple listeners for the gherkin parser, too.
Would make a 'progress' formatter doable, since it could count scenarios/steps during parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment