summaryrefslogtreecommitdiff
path: root/subplot.md
diff options
context:
space:
mode:
Diffstat (limited to 'subplot.md')
-rw-r--r--subplot.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/subplot.md b/subplot.md
index b2cdecf..d975e97 100644
--- a/subplot.md
+++ b/subplot.md
@@ -1609,6 +1609,7 @@ bibliography: [foo.bib, bar.bib]
"foo.bib",
"bar.bib"
],
+ "files": [],
"scenarios": []
}
~~~
@@ -1811,6 +1812,90 @@ This is another embedded file, and has the same name in uppercase.
```
~~~~
+## Steps must match bindings
+
+Subplot permits the binding author to define arbitrarily complex regular
+expressions for binding matches. In order to ensure that associating steps
+to bindings is both reliable and tractable, a step must match _exactly one_
+binding.
+
+```{#badbindings.yaml .file .yaml}
+- given: a binding
+ function: a_binding
+- given: a (?:broken)? binding
+ function: a_broken_binding
+ regex: true
+```
+
+### Steps which do not match bindings do not work
+
+~~~~{#nobinding.md .file .markdown}
+---
+title: No bindings available
+bindings:
+- badbindings.yaml
+...
+# Broken scenario because step has no binding
+
+```scenario
+given a missing binding
+then nothing works
+```
+~~~~
+
+```scenario
+given file nobinding.md
+and file badbindings.yaml
+when I try to run sp-codegen --run nobinding.md -o test.py
+then exit code is non-zero
+```
+
+### Steps which match more than one binding do not work
+
+~~~~{#twobindings.md .file .markdown}
+---
+title: Two bindings match
+bindings:
+- badbindings.yaml
+...
+# Broken scenario because step has two possible bindings
+
+```scenario
+given a binding
+```
+~~~~
+
+```scenario
+given file twobindings.md
+and file badbindings.yaml
+when I try to run sp-codegen --run twobindings.md -o test.py
+then exit code is non-zero
+```
+
+
+### List embedded files
+
+The `sp-meta` command lists embedded files in its output.
+
+~~~scenario
+given file two-embedded.md
+when I run sp-meta two-embedded.md
+then output matches /foo.txt/
+and output matches /bar.yaml/
+~~~
+
+~~~~~~{#two-embedded.md .file .markdown .numberLines}
+---
+title: Two embedded files
+...
+
+~~~{#foo.txt .file}
+~~~
+
+~~~{#bar.yaml. .file}
+~~~
+~~~~~~
+
## Embedded graphs