summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-04-18 15:21:52 +0100
committerLars Wirzenius <liw@liw.fi>2014-04-18 15:21:52 +0100
commit99f904117eaf11ee67688b14d93b5145ad939fd8 (patch)
tree23a5c055eea57b29ee59d017e6f29c10b91b55c7 /yarns
parent23b02334f96ee72e0ba68daa397efcdb890f911e (diff)
downloaddistix-99f904117eaf11ee67688b14d93b5145ad939fd8.tar.gz
Add list and new subcommands
Diffstat (limited to 'yarns')
-rw-r--r--yarns/040-new.yarn9
-rw-r--r--yarns/900-implements.yarn12
2 files changed, 15 insertions, 6 deletions
diff --git a/yarns/040-new.yarn b/yarns/040-new.yarn
index e02dd32..566bc9b 100644
--- a/yarns/040-new.yarn
+++ b/yarns/040-new.yarn
@@ -5,6 +5,11 @@ This chapter has scenarios for creating new tickets.
SCENARIO create new ticket
WHEN user attempts to run distix init REPO
- AND user changes working directory to REPO
- AND user attempts to run distix new "A new ticket"
THEN attempt succeeded
+ WHEN user changes working directory to REPO
+ AND user attempts to run distix new new-ticket-title
+ THEN attempt succeeded
+
+ WHEN user attempts to run distix list
+ THEN attempt succeeded
+ AND output matches "^[0-9a-f]{7} new-ticket-title$"
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index fde41d8..8de6d7a 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -24,14 +24,14 @@ be, and changing there when running various commands.
IMPLEMENTS WHEN user attempts to run distix (.*)
cd "$DATADIR"
- cd "$(cat cwd || echo .)"
rm -f attempt.exit attempt.stdout attempt.stderr
+ cd "$(cat cwd || echo .)"
if "$SRCDIR/distix" --no-default-config $MATCH_1 \
- > attempt.stdout 2> $DATADIR/attempt.stderr
+ > "$DATADIR/attempt.stdout" 2> "$DATADIR/attempt.stderr"
then
- echo 0 > attempt.exit
+ echo 0 > "$DATADIR/attempt.exit"
else
- echo "$?" > attempt.exit
+ echo "$?" > "$DATADIR/attempt.exit"
fi
We also need steps for inspecting the results of attempting to run
@@ -51,6 +51,10 @@ distix.
printf "$MATCH_1" > "$DATADIR/temp-stdout"
diff -u "$DATADIR/temp-stdout" "$DATADIR/attempt.stdout"
+ IMPLEMENTS THEN output matches "(.*)"
+ cat "$DATADIR/attempt.stdout"
+ grep -P -e "$MATCH_1" "$DATADIR/attempt.stdout"
+
IMPLEMENTS THEN attempt failed
cat "$DATADIR/attempt.exit" # helps debugging scenarios
if grep -Fx 0 "$DATADIR/attempt.exit"