summaryrefslogtreecommitdiff
path: root/yarn.tests/snapshot.script
diff options
context:
space:
mode:
Diffstat (limited to 'yarn.tests/snapshot.script')
-rwxr-xr-xyarn.tests/snapshot.script41
1 files changed, 41 insertions, 0 deletions
diff --git a/yarn.tests/snapshot.script b/yarn.tests/snapshot.script
new file mode 100755
index 0000000..90db93e
--- /dev/null
+++ b/yarn.tests/snapshot.script
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -eu
+
+cat << EOF > "$DATADIR/foo.yarn"
+ SCENARIO foo
+ GIVEN foo
+ WHEN foo
+ THEN foo
+
+ IMPLEMENTS GIVEN foo
+ touch "\$DATADIR/foo.given"
+
+ IMPLEMENTS WHEN foo
+ touch "\$DATADIR/foo.when"
+
+ IMPLEMENTS THEN foo
+ touch "\$DATADIR/foo.then"
+EOF
+
+./yarn -q --snapshot --tempdir "$DATADIR/tmp" "$DATADIR/foo.yarn"
+
+test -e "$DATADIR/tmp/001-GIVEN-foo"
+test -e "$DATADIR/tmp/001-GIVEN-foo/foo.given"
+! test -e "$DATADIR/tmp/datadir/foo.when"
+! test -e "$DATADIR/tmp/datadir/foo.then"
+
+test -e "$DATADIR/tmp/002-WHEN-foo"
+test -e "$DATADIR/tmp/002-WHEN-foo/foo.given"
+test -e "$DATADIR/tmp/002-WHEN-foo/foo.when"
+! test -e "$DATADIR/tmp/002-WHEN-foo/foo.then"
+
+test -e "$DATADIR/tmp/003-THEN-foo"
+test -e "$DATADIR/tmp/003-THEN-foo/foo.given"
+test -e "$DATADIR/tmp/003-THEN-foo/foo.when"
+test -e "$DATADIR/tmp/003-THEN-foo/foo.then"
+
+test -e "$DATADIR/tmp/datadir"
+test -e "$DATADIR/tmp/datadir/foo.given"
+test -e "$DATADIR/tmp/datadir/foo.when"
+test -e "$DATADIR/tmp/datadir/foo.then"