-
-
Save mattwynne/253485 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My view is that we have two domains here - the specification domain, and the execution domain. Gherkin parses the specification model, The compiler translates from the specification model into the execution domain. | |
The formatters observe the execution, so should operate in that domain. The execution domain model has a mapping to the specification model which created it, so formatters can look up to find out, for example, the feature that a unit comes from, or whether a statement is from a background step or not. | |
before_features(features) # this allows the formatter to visit the specification model and build whatever representation of that model it wants to (e.g. count scenarios for a progress bar) | |
before_unit(unit) # unit could be a scenario or example row | |
before_statement(statement) # statement could be a Before/After hook, a background step or regular step | |
after_statement(statement, statement_result) | |
after_unit(unit, unit_result) | |
after_features |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment