summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-11-30 16:16:28 +0200
committerLars Wirzenius <liw@liw.fi>2019-11-30 19:22:49 +0200
commit7405a3f6faccfb856d430cfd08988c8dc35893c5 (patch)
tree6c151130e5ab1f2b73ea74f8395e4d018034e667
parent609101a8506c787af00b98b81daae4d432756d15 (diff)
downloadsubplot-7405a3f6faccfb856d430cfd08988c8dc35893c5.tar.gz
Add: sample subplot documents
-rw-r--r--.gitignore1
-rw-r--r--echo.md36
-rw-r--r--echo.yaml17
-rw-r--r--tomjon.md11
-rw-r--r--tomjon.yaml3
5 files changed, 68 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 53eaa21..61fb34c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/target
**/*.rs.bk
+*.pdf
diff --git a/echo.md b/echo.md
new file mode 100644
index 0000000..08072a0
--- /dev/null
+++ b/echo.md
@@ -0,0 +1,36 @@
+---
+title: "**echo**(1) acceptance tests"
+author: The Subplot project
+bindings: echo.yaml
+...
+
+Introduction
+=============================================================================
+
+**echo**(1) is a Unix command line tool, which writes its command line
+arguments to the standard output. This is a simple acceptance test
+suite for the `/bin/echo` implementation.
+
+No arguments
+=============================================================================
+
+Run `/bin/echo` without arguments.
+
+```subplot
+when user runs echo without arguments
+then exit code is 0
+and standard output contains a newline
+and standard error is empty
+```
+
+Hello, world
+=============================================================================
+
+This scenario runs `/bin/echo` to produce the output "hello, world".
+
+```subplot
+when user runs echo with arguments hello, world
+then exit code is 0
+and standard output contains "hello, world"
+and standard error is empty
+```
diff --git a/echo.yaml b/echo.yaml
new file mode 100644
index 0000000..6937d3d
--- /dev/null
+++ b/echo.yaml
@@ -0,0 +1,17 @@
+- when: user runs echo without arguments
+ function: run_echo_without_args
+
+- when: user runs echo with arguments (?P<args>.+)
+ function: run_echo_with_args
+
+- then: exit code is (?P<exit_code>\d+)
+ function: exit_code_is_zero
+
+- then: standard output contains a newline
+ function: stdout_is_a_newline
+
+- then: standard output contains "(?P<text>.*)"
+ function: stdout_is_text
+
+- then: standard error is empty
+ function: stderr_is_empty
diff --git a/tomjon.md b/tomjon.md
new file mode 100644
index 0000000..1ecbce5
--- /dev/null
+++ b/tomjon.md
@@ -0,0 +1,11 @@
+---
+title: "Tomjon"
+author: The Subplot project
+bindings: tomjon.yaml
+...
+
+```subplot
+given I am Tomjon
+when I declare myself king
+then there is applause
+```
diff --git a/tomjon.yaml b/tomjon.yaml
new file mode 100644
index 0000000..36371dc
--- /dev/null
+++ b/tomjon.yaml
@@ -0,0 +1,3 @@
+- given: I am (?P<name>\S+)
+- when: I declare myself king
+- then: there is applause