aboutsummaryrefslogtreecommitdiff
path: root/test/utils.bash
diff options
context:
space:
mode:
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 "$@"
+}