summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subplot.md60
1 files changed, 60 insertions, 0 deletions
diff --git a/subplot.md b/subplot.md
index b2cdecf..b99f397 100644
--- a/subplot.md
+++ b/subplot.md
@@ -1811,6 +1811,66 @@ 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
+```
+
## Embedded graphs