summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2023-11-11 10:43:50 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2023-11-11 10:43:50 +0000
commit2bf14f68ec463a30d2806b67158a64459b47a301 (patch)
treed71d23aae6f669d64d5da0c66dec4b724f940811
parent3105f0040111748c5b5e90b95ac36f27f8f9f0ed (diff)
downloadsubplot-2bf14f68ec463a30d2806b67158a64459b47a301.tar.gz
subplot: Validate some of the bindings semi-strictness
-rw-r--r--subplot.md68
1 files changed, 68 insertions, 0 deletions
diff --git a/subplot.md b/subplot.md
index 06e9e38..cc3857c 100644
--- a/subplot.md
+++ b/subplot.md
@@ -812,6 +812,74 @@ given file missing.md
~~~
+### Bindings file strictness - given when then
+
+The bindings file is semi-strict. For example you must have only one
+of `given`, `when`, or `then` in your binding.
+
+
+```scenario
+given file badbindingsgwt.subplot
+and file badbindingsgwt.md
+and file badbindingsgwt.yaml
+and an installed subplot
+when I try to run subplot docgen --output ignored.html badbindingsgwt.subplot
+then command fails
+and stderr contains "binding has more than one keyword"
+```
+
+~~~{#badbindingsgwt.subplot .file .yaml .numberLines}
+title: Bad bindings cause everything to fail
+markdowns: [badbindingsgwt.md]
+bindings: [badbindingsgwt.yaml]
+~~~
+
+~~~{#badbindingsgwt.md .file .markdown .numberLines}
+# Bad bindings
+```scenario
+given we won't reach here
+```
+~~~
+
+~~~{#badbindingsgwt.yaml .file .yaml .numberLines}
+- given: we won't reach here
+ then: we won't reach here
+~~~
+
+### Bindings file strictness - unknown field
+
+The bindings file is semi-strict. For example, you must not have keys
+in the bindings file which are not known to Subplot.
+
+
+```scenario
+given file badbindingsuf.subplot
+and file badbindingsuf.md
+and file badbindingsuf.yaml
+and an installed subplot
+when I try to run subplot docgen --output ignored.html badbindingsuf.subplot
+then command fails
+and stderr contains "unknown field `function`"
+```
+
+~~~{#badbindingsuf.subplot .file .yaml .numberLines}
+title: Bad bindings cause everything to fail
+markdowns: [badbindingsuf.md]
+bindings: [badbindingsuf.yaml]
+~~~
+
+~~~{#badbindingsuf.md .file .markdown .numberLines}
+# Bad bindings
+```scenario
+given we won't reach here
+```
+~~~
+
+~~~{#badbindingsuf.yaml .file .yaml .numberLines}
+- given: we won't reach here
+ function: old_school_function
+~~~
+
## Functions file
Functions implementing steps are supported in Bash and Python. The