From 7da7185129855603cfc49779c76f5d09a429cdda Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 7 Oct 2022 08:55:58 +0300 Subject: docs(tutorial.md): add echo.subplot Sponsored-by: author --- tutorial.mdwn | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tutorial.mdwn b/tutorial.mdwn index aa55597..1c5424c 100644 --- a/tutorial.mdwn +++ b/tutorial.mdwn @@ -131,8 +131,8 @@ to be implemented by programmers so that computers also understand them. Each step corresponds to a function, written in a programming language such as Python, and a YAML file **binds** the step to the function, using a pattern to capture relevant parts of the step. The -pattern can be simple or a full PCRE regular expression. A binding -file might look like this: +pattern can be simple or a full PCRE regular expression. A bindings +file `echo.yaml` might look like this: ```yaml - when: user runs echo without arguments @@ -159,6 +159,21 @@ This means that for a step saying 'then standard output contains "foo"', the Python function `stdout_is_text` is called and given the string `foo` as an argument called `text`. +To join the Markdown file, the bindings file, and the step +implementations together, you also need a YAML metadata file: + +~~~yaml +title: echo acceptance criteria +bindings: +- echo.yaml +impl: + python: + - echo.py +~~~ + +You would call this file something like `echo.subplot` to distinguish +it from the bindings file, `echo.yaml`. + The developers on the project, in collaboration with the testing team, need to supply both the bindings and the implementation functions in whatever language the test suite is written in (Python in this -- cgit v1.2.1