Expand description
The .expect file format: a Gherkin-flavoured language for a suite’s vocabulary,
expectations and user stories.
Suite: Kettle
Vocabulary:
State: the kettle is off | heating | dry
State: the dial is 0..100 %
Event: the user presses reset
Background:
Given the kettle is off
Feature: Heating
Expectation: Turning the dial up starts the kettle
Given the kettle is off
When the dial is above 55 %
Then the kettle is heating
Story: First cup
As a tea drinker
I want to start the kettle by turning the dial
Scenario: Turn it on
When the dial is 80 %
Then the kettle is heatingload_dir reads every *.expect file under a directory into one suite;
load_sources does the same from strings.
Modules§
- step
- Step text to meaning. A step is either an event (“the user presses reset”) or a fact about
a state:
<subject> is [not] <predicate>, where the predicate is one or more of the state’s values (“off or heating”) or, for numbers, a comparison (“above 55 %”, “at most 10”, “between 20 and 40 %”, “0 %”). A Then can also be relative:<subject> goes up by <n>,goes down by <n>orstays the same.
Structs§
- Loaded
- A suite and everything wrong with it. Check
Loaded::has_errorsbefore using the suite: steps that didn’t resolve are left out of it.
Constants§
Functions§
- load_
dir - Every
*.expectfile underdir(recursively, in path order) as one suite, named by itsSuite:line or else after the directory. File names in diagnostics are relative todir. - load_
dir_ for - As
load_dir, read forplatform. - load_
sources - Parse named sources, in order, as one suite (for its default platform).
- load_
sources_ for - As
load_sources, read forplatform(seelens): its variants replace the plain lines and what isOn:elsewhere is left out.Noneis the default platform.