summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-04-18 14:57:45 +0100
committerLars Wirzenius <liw@liw.fi>2014-04-18 14:57:45 +0100
commit23b02334f96ee72e0ba68daa397efcdb890f911e (patch)
tree715b1e9d34eab9d6de611437b1e7d6537f537988 /yarns
parent479bf6ca1fd0c2061d5bd84cf4f7abf22d9437f0 (diff)
downloaddistix-23b02334f96ee72e0ba68daa397efcdb890f911e.tar.gz
Add initial test for creating a ticket
Diffstat (limited to 'yarns')
-rw-r--r--yarns/040-new.yarn10
-rw-r--r--yarns/900-implements.yarn10
2 files changed, 17 insertions, 3 deletions
diff --git a/yarns/040-new.yarn b/yarns/040-new.yarn
new file mode 100644
index 0000000..e02dd32
--- /dev/null
+++ b/yarns/040-new.yarn
@@ -0,0 +1,10 @@
+Create new ticket
+=================
+
+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
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index cc4c003..fde41d8 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -15,12 +15,16 @@ 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.
-Note that we change the working directory to `$DATADIR` so that any
-filename arguments the step gives refer to files there rather than in
-`$SRCDIR`, which is the default working directory for step execution.
+User needs to change directory. Since each step is run in a new shell,
+we do this by keeping track ourselves of where the scenario wants to
+be, and changing there when running various commands.
+
+ IMPLEMENTS WHEN user changes working directory to (\S+)
+ printf "%s" "$MATCH_1" > "$DATADIR/cwd"
IMPLEMENTS WHEN user attempts to run distix (.*)
cd "$DATADIR"
+ cd "$(cat cwd || echo .)"
rm -f attempt.exit attempt.stdout attempt.stderr
if "$SRCDIR/distix" --no-default-config $MATCH_1 \
> attempt.stdout 2> $DATADIR/attempt.stderr