summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-11-15 14:33:23 +0000
committerLars Wirzenius <liw@liw.fi>2013-11-15 14:33:23 +0000
commitc8068e5b2aac729ac560bb685bf67c7e31ade2d1 (patch)
treefcc1d79e1973cd12f214837652b5af7f4a0cc102
parentb64f4810bbe24c0384535afb202d6c2bd2ee6214 (diff)
parentc6c8f2c96eb90f1af6ff9115ce0136eb82389b5b (diff)
downloadcmdtest-c8068e5b2aac729ac560bb685bf67c7e31ade2d1.tar.gz
Merge remote-tracking branch 'origin/pf/fix-no-thens-bug'
-rwxr-xr-xyarn2
-rwxr-xr-xyarn.tests/two-no-thens.exit1
-rwxr-xr-xyarn.tests/two-no-thens.script23
-rwxr-xr-xyarn.tests/two-no-thens.stderr3
4 files changed, 28 insertions, 1 deletions
diff --git a/yarn b/yarn
index f8ca0cd..c3cba28 100755
--- a/yarn
+++ b/yarn
@@ -198,7 +198,7 @@ class YarnRunner(cliapp.Application):
if no_thens:
raise cliapp.AppException(
'Some scenarios have no THENs:\n%s' %
- ''.join(' "%s"\n' % s.name for s in scenarios))
+ ''.join(' "%s"\n' % s.name for s in no_thens))
def connect_implementations(self, scenarios, implementations):
for scenario in scenarios:
diff --git a/yarn.tests/two-no-thens.exit b/yarn.tests/two-no-thens.exit
new file mode 100755
index 0000000..d00491f
--- /dev/null
+++ b/yarn.tests/two-no-thens.exit
@@ -0,0 +1 @@
+1
diff --git a/yarn.tests/two-no-thens.script b/yarn.tests/two-no-thens.script
new file mode 100755
index 0000000..a6a67fd
--- /dev/null
+++ b/yarn.tests/two-no-thens.script
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -eu
+
+
+cat <<EOF > "$DATADIR/1.yarn"
+ SCENARIO valid scenario
+ GIVEN statement 1
+ THEN statement 2
+
+ SCENARIO invalid scenario
+ GIVEN statement 1
+
+ IMPLEMENTS GIVEN statement (\d)
+ true
+
+ IMPLEMENTS THEN statement (\d)
+ true
+
+
+EOF
+
+./run-yarn "$DATADIR/1.yarn"
diff --git a/yarn.tests/two-no-thens.stderr b/yarn.tests/two-no-thens.stderr
new file mode 100755
index 0000000..4599b30
--- /dev/null
+++ b/yarn.tests/two-no-thens.stderr
@@ -0,0 +1,3 @@
+ERROR: Some scenarios have no THENs:
+ "invalid scenario"
+