summaryrefslogtreecommitdiff
path: root/fable-arch.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-07-27 11:15:29 +0300
committerLars Wirzenius <liw@liw.fi>2019-07-27 11:15:29 +0300
commitea4c742aca3d3163943e6eb660b0a6ed2756353b (patch)
tree6e730290eab9ed00883d2da3be87ce0afd65fea5 /fable-arch.md
parent656d75a45bc171477e070a734c4eb940d1f15254 (diff)
downloadfable-poc-ea4c742aca3d3163943e6eb660b0a6ed2756353b.tar.gz
Change: how test data is given to fables
Diffstat (limited to 'fable-arch.md')
-rw-r--r--fable-arch.md76
1 files changed, 48 insertions, 28 deletions
diff --git a/fable-arch.md b/fable-arch.md
index 5e34aaa..785f468 100644
--- a/fable-arch.md
+++ b/fable-arch.md
@@ -357,37 +357,57 @@ other resource constraints.
# Acceptance tests for Fable {#acceptance}
-FIXME: This needs to be written eventually, when Fable is implemented.
-
-## Simple scenario
-
-We test that Fable can execute a very simple scenario. The test is
-based on generating the test program from an input file, running the
-test program, and examining the log file. This will require that the
-generated test program logs the things it does in a known format.
-Effectively, the log messages become a part of the contract.
-
-````fable
-given file "simple.md" containing
- # Simple
- ```fable
- given precondition foo
- when I do bar
- then bar was done
- ```
-and file "simple.yaml" containing
- - given: precondition foo
- function: nop
- - when: I do bar
- function: nop
- - then: bar was done
- function: nop
-and file "simple.py" containing
- def foo(ctx): pass
+## The simplest possible scenario
+
+This tests that Fable can run a simplest possible scenario
+successfully. The test is based on generating the test program from an
+input file, running the test program, and examining the log file.
+
+```fable
+given files simple.md, simple.yaml, and simple.py
when I run ftt-codegen --run simple.md
then log file says scenario "Simple" was run
and log file says step "given precondition foo" was run
and log file says step "when I do bar" was run
and log file says step "then bar was don" was run
and program finished successfully
-````
+```
+
+### simple.md&mdash;markdown file
+
+~~~~{#simple.md}
+# Simple
+This is the simplest possible test scenario
+
+```fable
+given precondition foo
+when I do bar
+then bar was done
+```
+~~~~
+
+### simple.yaml&mdash;bindings file
+
+```{#simple.yaml}
+- given: precondition foo
+ function: precond
+- when: I do bar
+ function: do
+- then: bar was done
+ function: was_done
+```
+
+### simple.py&mdash;Python file with functions
+
+```{#simple.py}
+def precond(ctx):
+ pass
+def do(ctx):
+ pass
+def was_done(ctx):
+ pass
+```
+
+## Two scenarios in the same markdown file
+## A scenario step fails
+##