diff options
Diffstat (limited to 'subplotlib/runcmd.md')
-rw-r--r-- | subplotlib/runcmd.md | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/subplotlib/runcmd.md b/subplotlib/runcmd.md index d6210fb..50e41f6 100644 --- a/subplotlib/runcmd.md +++ b/subplotlib/runcmd.md @@ -22,8 +22,8 @@ they're verified. It uses the steps and functions from the command, then examine the exit code, standard output (stdout for short), or standard error output (stderr) of the command. -The scenarios use the Unix commands `/bin/true` and `/bin/false` to -generate exit codes, and `/bin/echo` to produce stdout. To generate +The scenarios use the Unix commands `true` and `false` to +generate exit codes, and `echo` to produce stdout. To generate stderr, they use the little helper script below. ```{#err.sh .file .sh .numberLines} @@ -40,7 +40,7 @@ variations. ## Successful execution ```scenario -when I run /bin/true +when I run true then exit code is 0 and command is successful ``` @@ -49,7 +49,7 @@ and command is successful ```scenario given a directory xyzzy -when I run, in xyzzy, /bin/pwd +when I run, in xyzzy, pwd then exit code is 0 then command is successful then stdout contains "/xyzzy" @@ -58,7 +58,7 @@ then stdout contains "/xyzzy" ## Failed execution ```scenario -when I try to run /bin/false +when I try to run false then exit code is not 0 and command fails ``` @@ -67,7 +67,7 @@ and command fails ```scenario given a directory xyzzy -when I try to run, in xyzzy, /bin/false +when I try to run, in xyzzy, false then exit code is not 0 and command fails ``` @@ -84,7 +84,7 @@ to the reader what's inside. Also, C-style string escapes are understood. ```scenario -when I run /bin/echo hello, world +when I run echo hello, world then stdout is exactly "hello, world\n" ``` @@ -102,7 +102,7 @@ Exact string comparisons are not always enough, so we can verify a sub-string is in output. ```scenario -when I run /bin/echo hello, world +when I run echo hello, world then stdout contains "world\n" and exit code is 0 ``` @@ -122,7 +122,7 @@ regular expression. Note that the regular expression is not delimited and does not get any C-style string escaped decoded. ```scenario -when I run /bin/echo hello, world +when I run echo hello, world then stdout matches regex world$ ``` @@ -142,7 +142,7 @@ have something we want to avoid. ## Check stdout is not exactly something ```scenario -when I run /bin/echo hi +when I run echo hi then stdout isn't exactly "hello, world\n" ``` @@ -157,7 +157,7 @@ then stderr isn't exactly "hello, world\n" ## Check stdout doesn't contain sub-string ```scenario -when I run /bin/echo hi +when I run echo hi then stdout doesn't contain "world" ``` @@ -172,7 +172,7 @@ then stderr doesn't contain "world" ## Check stdout doesn't match regular expression ```scenario -when I run /bin/echo hi +when I run echo hi then stdout doesn't match regex world$ ``` |