aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/app-init.bats11
-rwxr-xr-xtest/data/app-a/hooks/post-install5
-rw-r--r--test/data/app-a/scripts/postinstall21
-rw-r--r--test/utils.bash1
4 files changed, 13 insertions, 25 deletions
diff --git a/test/app-init.bats b/test/app-init.bats
index b62c42e..4e7c281 100755
--- a/test/app-init.bats
+++ b/test/app-init.bats
@@ -31,12 +31,15 @@ load utils
fi
app init -d my-app maven -r "file://$BATS_TMPDIR/repo" org.example:app-a:1.0-SNAPSHOT; echo_lines
- eq '$status' 0
- eq '${lines[0]}' "Resolving version 1.0-SNAPSHOT..."
+ eq '$status' 0
+ eq '${lines[0]}' "Resolving version 1.0-SNAPSHOT..."
match '${lines[1]}' "Resolved version to 1.0-.*"
match '${lines[2]}' "Downloading org.example:app-a:1.0-.*"
-
- eq '${#lines[*]}' 3
+ eq '${lines[3]}' "Unpacking..."
+ match '${lines[4]}' "Creating current symlink for version 1.0-.*"
+ eq '${lines[5]}' "Running hook: post-install"
+ eq '${lines[6]}' "Post install"
+ eq '${#lines[*]}' 7
is_directory "my-app/.app"
}
diff --git a/test/data/app-a/hooks/post-install b/test/data/app-a/hooks/post-install
new file mode 100755
index 0000000..99ad974
--- /dev/null
+++ b/test/data/app-a/hooks/post-install
@@ -0,0 +1,5 @@
+#!/bin/bash -e
+
+set -u
+
+echo "Post install"
diff --git a/test/data/app-a/scripts/postinstall b/test/data/app-a/scripts/postinstall
deleted file mode 100644
index dc176ff..0000000
--- a/test/data/app-a/scripts/postinstall
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -e
-
-echo "Hello World!"
-
-if [ -d etc/$APPSH_INSTANCE ]
-then
- find etc/$APPSH_INSTANCE -maxdepth 1 -type f | while read file
- do
- cp $file .
- done
-fi
-
-LOGS=$APPSH_APPS/$APPSH_NAME/$APPSH_INSTANCE/logs
-
-if [ ! -d $LOGS ]
-then
- echo "Creating logs directory"
- mkdir $LOGS
-fi
-
-ln -s $LOGS logs
diff --git a/test/utils.bash b/test/utils.bash
index fa2602e..3a9d425 100644
--- a/test/utils.bash
+++ b/test/utils.bash
@@ -7,6 +7,7 @@ exit_usage=1
exit_usage_wrong=0
setup() {
+ find test/data -name \*.zip | xargs rm -f
PATH=/bin:/usr/bin
PATH=$PATH:$APPSH_HOME
APPSH_HOME=$(cd $BATS_TEST_DIRNAME/..; echo `pwd`)