diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-04-18 11:35:23 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-04-18 11:35:23 +0100 |
commit | a87655497c29520853ef244b3af49ebd725fab99 (patch) | |
tree | 0decb61fa88049058099f11edb71bde54e449568 /yarns | |
parent | ad59c525fc65501f045f8099860e3879bf731348 (diff) | |
download | distix-a87655497c29520853ef244b3af49ebd725fab99.tar.gz |
Add initial yarns for distix _list
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/010.yarn | 12 | ||||
-rw-r--r-- | yarns/020-metadata-manipulation.yarn | 18 | ||||
-rw-r--r-- | yarns/900-implements.yarn | 43 |
3 files changed, 73 insertions, 0 deletions
diff --git a/yarns/010.yarn b/yarns/010.yarn new file mode 100644 index 0000000..b0ce6a4 --- /dev/null +++ b/yarns/010.yarn @@ -0,0 +1,12 @@ +Introduction +============ + +This is the black box testing suite for distix, a distributed +ticketing system. The test suite is written to be run by +[yarn], and is in the form of scenarios. Each scenario is meant to be +understandable by a reasonably invested person, who need not be a +programmer. See the yarn documentation for more information. + +[yarn]: http://liw.fi/cmdtest/ + + diff --git a/yarns/020-metadata-manipulation.yarn b/yarns/020-metadata-manipulation.yarn new file mode 100644 index 0000000..550ae1b --- /dev/null +++ b/yarns/020-metadata-manipulation.yarn @@ -0,0 +1,18 @@ +Metadata manipulation +===================== + +This chapter contains scenarios for testing the distix hidden commands +for manipulation of metadata files. + +There are three commands, `_set`, `_get`, and `_list`, and they'll be +tested together, since they interact with each other. + + SCENARIO metadata manipulation + +To start with, the `_list` command should give an error if the +metadata file doesn't exist. + + WHEN user attempts to run distix _list METADATA + THEN attempt failed + AND error message matches FIXME + diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn new file mode 100644 index 0000000..7a8e1b7 --- /dev/null +++ b/yarns/900-implements.yarn @@ -0,0 +1,43 @@ +Step implementations +==================== + +This chapter contains implementations of each step. See the [yarn] +manual for details and examples. + + +Running distix +-------------- + +We need a way for the steps to run distix with various command line +arguments. Instead of having a different IMPLEMENTS step for each +command that needs to be run, we'll have one fairly generic one. It'll +allow the step to provide the command line arguments, but then also +adds in options and things to make distix be isolated from, say, +global configuration etc. + + IMPLEMENTS WHEN user attempts to run distix (.*) + rm -f "$DATADIR/attempt.exit" + rm -f "$DATADIR/attempt.stdout" + rm -f "$DATADIR/attempt.stderr" + if "$SRCDIR/distix" --no-default-config "$MATCH_1" \ + > "$DATADIR/attempt.stdout" 2> "$DATADIR/attempt.stderr" + then + echo 0 > "$DATADIR/attempt.exit" + else + echo "$?" > "$DATADIR/attempt.exit" + fi + +We also need steps for inspecting the results of attempting to run +distix. + + IMPLEMENTS THEN attempt failed + cat "$DATADIR/attempt.exit" # helps debugging scenarios + if grep -Fx 0 "$DATADIR/attempt.exit" + then + echo "Attempt should have failed, but didn't" 1>&2 + exit 1 + fi + + IMPLEMENTS THEN error message matches (.*) + cat "$DATADIR/attempt.stderr" + grep -e "$MATCH_1" "$DATADIR/attempt.stderr" |