diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-11-11 16:09:12 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-11-11 16:09:12 +0000 |
commit | add9bdb828833e6086b6f49df98fc655be897875 (patch) | |
tree | c5e2a24cc5e6368b21e237298b2bf584c37be321 /subplot.md | |
parent | ef9d59ae8b2529d71c3d4a732751c5b1cbec322a (diff) | |
parent | 2bf14f68ec463a30d2806b67158a64459b47a301 (diff) | |
download | subplot-add9bdb828833e6086b6f49df98fc655be897875.tar.gz |
Merge branch 'fix-320' into 'main'
Make bindings parsing more strict, and validate that strictness
Closes #320
See merge request subplot/subplot!364
Diffstat (limited to 'subplot.md')
-rw-r--r-- | subplot.md | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -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 |