aboutsummaryrefslogtreecommitdiff
path: root/test/utils.bash
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-10-14 08:55:36 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-10-14 08:55:36 +0200
commite9a22d5165c2dda5a0e10506977081222549a8eb (patch)
tree995e471a537719ecd950dfdccb8043836ab406ce /test/utils.bash
parenta7a62352c46b5d2b37baaa09f8145b1171ca79fb (diff)
downloadapp.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.gz
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.bz2
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.tar.xz
app.sh-e9a22d5165c2dda5a0e10506977081222549a8eb.zip
o Making sure ./app can be symlinked to an installation.
o More tests.
Diffstat (limited to 'test/utils.bash')
-rw-r--r--test/utils.bash24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/utils.bash b/test/utils.bash
new file mode 100644
index 0000000..eacabe8
--- /dev/null
+++ b/test/utils.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+workdir=test-run
+
+# TODO: assert that the exit code is 1 for 'usage' outputs.
+exit_usage=1
+exit_usage_wrong=0
+
+echo_lines() {
+ for line in "${lines[@]}"; do echo $line; done
+}
+
+APPSH=$(pwd)/app
+
+setup() {
+ rm -rf $BATS_TMPDIR/app.sh
+ mkdir $BATS_TMPDIR/app.sh
+ cd $BATS_TMPDIR/app.sh
+ ln -s $APPSH
+}
+
+app() {
+ run ./app "$@"
+}