diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-01-07 18:01:46 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-01-07 18:01:46 +0200 |
commit | 9345fcce3615091f080e271435035c196bdce9c6 (patch) | |
tree | 5ab927d8dce5b1008822ed78f76191ce2189a5f7 | |
parent | b59e8825b26c21a0c610072d367293c2d3d64376 (diff) | |
download | distix-9345fcce3615091f080e271435035c196bdce9c6.tar.gz |
Fix tests to handle new "distix list" output formatting
-rw-r--r-- | yarns/040-new.yarn | 2 | ||||
-rw-r--r-- | yarns/080-import-mail.yarn | 14 | ||||
-rw-r--r-- | yarns/900-implements.yarn | 5 |
3 files changed, 10 insertions, 11 deletions
diff --git a/yarns/040-new.yarn b/yarns/040-new.yarn index 4ee5345..e4d36ff 100644 --- a/yarns/040-new.yarn +++ b/yarns/040-new.yarn @@ -21,7 +21,7 @@ We create a new ticket, with a title that contains non-ASCII text. WHEN user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* new-ticket-title-gröt$" + AND output matches "^new-ticket-title-gröt$" AND first ticket id is captured as $TID AND ticket id $TID 7-nybble prefix is $PREFIX diff --git a/yarns/080-import-mail.yarn b/yarns/080-import-mail.yarn index ada7182..5fff421 100644 --- a/yarns/080-import-mail.yarn +++ b/yarns/080-import-mail.yarn @@ -23,7 +23,7 @@ will read the e-mail from its standard input. WHEN user changes working directory to REPO AND user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* bar$" + AND output matches "^bar$" Import one email twice. It should result in the mail existing only once in the ticket. @@ -61,7 +61,7 @@ Next, import an mbox. WHEN user changes working directory to REPO AND user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* bar$" + AND output matches "^bar$" Next, import a Maildir. @@ -78,7 +78,7 @@ Next, import a Maildir. WHEN user changes working directory to REPO AND user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* bar$" + AND output matches "^bar$" When importing e-mails, distix needs to automatically recognise when they belong existing tickets: if the new mail refers to a mail in an @@ -102,8 +102,8 @@ headers. WHEN user changes working directory to REPO AND user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* bar$" - AND output doesn't match "^[0-9a-f]{32} .* blerf$" + AND output matches "^bar$" + AND output doesn't match "^blerf$" Ditto, but for mailboxes. @@ -123,8 +123,8 @@ Ditto, but for mailboxes. WHEN user changes working directory to REPO AND user attempts to run distix list THEN attempt succeeded - AND output matches "^[0-9a-f]{32} .* bar$" - AND output doesn't match "^[0-9a-f]{32} .* blerf$" + AND output matches "^bar$" + AND output doesn't match "^blerf$" When users send new mails to tickets that are already closed, the "status" key needs to get updated. In other words, a ticket that has diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index 3aed634..2931361 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -43,7 +43,6 @@ be, and changing there when running various commands. fi IMPLEMENTS WHEN user attempts to run distix show \$PREFIX -b # Yarn sets $HOME to point at an empty temporary directory. # Set up a simple git config so tests can use git. git config --global user.email 'Tomjon <tomjon@example.com>' @@ -67,7 +66,7 @@ b "$SRCDIR/distix" --no-default-config --quiet \ --log "$DATADIR/distix.log" list | - awk '{ print $1 }' > "$DATADIR/tickets.list" + awk '/^ / { print $2 }' > "$DATADIR/tickets.list" cat "$DATADIR/tickets.list" | while read ticket @@ -109,7 +108,7 @@ distix. IMPLEMENTS THEN first ticket id is captured as \$TID # We assume previous command run was distix list. # Each line starts with a full ticket id. - head -n1 "$DATADIR/attempt.stdout" | awk '{print $1}' \ + awk 'NR == 2 { print $2; exit }' "$DATADIR/attempt.stdout" \ > "$DATADIR/ticket-id-1" IMPLEMENTS THEN attempt failed |