commit d34e17f39e77aae671c324c56f9f6950f3b67eec
parent e2f5e318e279d24d6730262221354da8e0a54976
Author: Richard Ipsum <richardipsum@vx21.xyz>
Date: Wed, 23 Dec 2020 14:36:26 +0000
tyarn.1: document AND step
Also make point about platforms clearer.
Diffstat:
M | tyarn.1 | | | 38 | +++++++++++++++++++++++++++++++++++--- |
1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/tyarn.1 b/tyarn.1
@@ -22,7 +22,7 @@ the SCENARIO line contains the name of the scenario (which must be unique).
.PP
A scenario is composed of a set of steps, at a minimum a scenario must include
at least one WHEN step and at least one THEN step, though it may also provide
-more than one of each. In addition to the mandatory steps a scenario may
+more than one of each. A scenario may also
optionally include ASSUMING, GIVEN, and FINALLY steps.
.PP
GIVEN describes a condition that must be satisfied before the test can be
@@ -37,9 +37,41 @@ The ASSUMING step can be used to state an assertion that must be
true in order for the scenario to be run. If the assertion is false
then the scenario is skipped and will not be executed. This can be
useful for testing on different platforms where you may want to
-skip tests that are not supported on the current platform.
+skip tests that are not supported on the platform on which the tests
+are being run. In addition
+to these step types, a special AND type can also be used
+to indicate that the current step has the same type as the previous step.
+For example, the scenario:
.PP
-A corresponding implementation must be provided for each step,
+.nf
+.RS
+SCENARIO copy a file
+GIVEN a file F
+GIVEN a file A
+WHEN the file F is copied to G
+WHEN the file A is copied to B
+THEN the file A exists
+THEN the file B exists
+.RE
+.fi
+.PP
+can instead be written as:
+.PP
+.RS
+.nf
+SCENARIO copy a file
+GIVEN a file F
+AND a file A
+WHEN the file F is copied to G
+AND the file A is copied to B
+THEN the file A exists
+AND the file B exists
+.RE
+.fi
+.PP
+The AND step type mostly helps scenarios be a bit more readable in English.
+.PP
+A corresponding implementation must be provided for each scenario step,
for example shown below are the implementation steps for the
example scenario given above.
.PP