summaryrefslogtreecommitdiff
path: root/subplot.yaml
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-04-18 14:06:23 +0300
committerLars Wirzenius <liw@liw.fi>2020-04-19 15:28:48 +0300
commit30447917d785345dd99ee8cfe601b94ff413260c (patch)
tree998c237c45e10b3c752f94c6e26b1b44cc5e1231 /subplot.yaml
parent9f1bd185832c6e8acfafa6c66545a1921891da2e (diff)
downloadsubplot-30447917d785345dd99ee8cfe601b94ff413260c.tar.gz
Add: acceptance criteria for simple patterns
This adds scenarios for regex patterns capture and simple pattern capture from scenario steps, and additionally makes use of simple patterns everywhere possible in the examples.
Diffstat (limited to 'subplot.yaml')
-rw-r--r--subplot.yaml34
1 files changed, 22 insertions, 12 deletions
diff --git a/subplot.yaml b/subplot.yaml
index 0bb5e23..55e4c6c 100644
--- a/subplot.yaml
+++ b/subplot.yaml
@@ -1,62 +1,72 @@
-- given: file (?P<filename>\S+)
+- given: file {filename}
function: create_file
- given: file (?P<filename>\S+) has modification time (?P<y>\d+)-(?P<mon>\d+)-(?P<d>\d+) (?P<h>\d+):(?P<min>\d+):(?P<s>\d+)
function: touch_file
+ regex: true
-- when: I remember the metadata for (?P<filename>\S+)
+- when: I remember the metadata for {filename}
function: remember_metadata
-- when: I run sp-docgen (?P<md>\S+) -o (?P<output>\S+)
+- when: I run sp-docgen {md} -o {output}
function: run_docgen
-- when: I run sp-docgen (?P<md>\S+) -o (?P<output>\S+) --date=(?P<date>\S+)
+- when: I run sp-docgen {md} -o {output} --date={date}
function: run_docgen_with_date
-- when: I try to run sp-docgen (?P<md>\S+) -o (?P<output>\S+)
+- when: I try to run sp-docgen {md} -o {output}
function: try_docgen
-- when: I run sp-codegen --run (?P<filename>\S+) -o test.py
+- when: I run sp-codegen --run {filename} -o test.py
function: run_codegen
-- when: I try to run sp-codegen --run (?P<filename>\S+) -o test.py
+- when: I try to run sp-codegen --run {filename} -o test.py
function: try_codegen
-- when: I run sp-meta (?P<filename>\S+)
+- when: I run sp-meta {filename}
function: run_meta
-- when: I run pandoc --filter sp-filter (?P<filename>\S+) -o (?P<output>\S+)
+- when: I run pandoc --filter sp-filter {filename} -o {output}
function: run_pandoc_with_filter
- then: exit code is non-zero
function: exit_code_nonzero
-- then: file (?P<filename>\S+) exists
+- then: file {filename} exists
function: file_exists
-- then: file (?P<filename>\S+) does not exist
+- then: file {filename} does not exist
function: file_does_not_exist
- then: file (?P<filename>\S+) matches /(?P<regex>.+)/
function: file_matches
+ regex: true
- then: file (?P<filename>\S+) contains "(?P<pattern>.+)"
function: file_contains
+ regex: true
-- then: (?P<filename>\S+) has the same metadata as before
+- then: "{filename} has the same metadata as before"
function: has_same_metadata_as_remembered
+- then: function got {arg} as an argument
+ function: function_got_arg
+
- then: output matches /(?P<pattern>.+)/
function: stdout_matches
+ regex: true
- then: scenario "(?P<name>.+)" was run
function: scenario_was_run
+ regex: true
- then: step "(?P<keyword>given|when|then) (?P<name>.+)" was run
function: step_was_run
+ regex: true
- then: program finished successfully
function: exit_code_zero
- then: only files (?P<filenames>.+) exist
function: only_these_files_exist
+ regex: true