aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-10-17 15:20:45 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-10-17 15:20:45 +0200
commitd8890e75cf83504320ad12b657112cd5347fb600 (patch)
tree4a74422e225059597fdd61414991a723f41ef471 /test
parent019129977ea279851386528be8a76ee33ff8392b (diff)
downloadapp.sh-d8890e75cf83504320ad12b657112cd5347fb600.tar.gz
app.sh-d8890e75cf83504320ad12b657112cd5347fb600.tar.bz2
app.sh-d8890e75cf83504320ad12b657112cd5347fb600.tar.xz
app.sh-d8890e75cf83504320ad12b657112cd5347fb600.zip
o Reworking conf to work as documented. Adding test case.
Diffstat (limited to 'test')
-rwxr-xr-xtest/app-conf.bats70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/app-conf.bats b/test/app-conf.bats
new file mode 100755
index 0000000..eb2d325
--- /dev/null
+++ b/test/app-conf.bats
@@ -0,0 +1,70 @@
+#!/usr/bin/env bats
+# vim: set filetype=sh:
+
+load utils
+
+@test "./app conf - happy day" {
+ i=env-a
+ n=app-a
+
+ mkzip "app-a"
+ app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n $n -i $i -v 1.0
+ [ $status -eq 0 ]
+
+ app -n $n -i $i conf; echo_lines
+ [ $status -eq 0 ]
+ [ "$output" = "app.bin bin/app-a " ]
+
+ app -n $n -i $i conf set group.foo bar; echo_lines
+ [ $status -eq 0 ]
+
+ app -n $n -i $i conf; echo_lines
+ [ $status -eq 0 ]
+ [ "$output" = "app.bin bin/app-a
+group.foo bar " ]
+
+ app -n $n -i $i conf delete group.foo; echo_lines
+ [ $status -eq 0 ]
+
+ app -n $n -i $i conf; echo_lines
+ [ $status -eq 0 ]
+ [ "$output" = "app.bin bin/app-a " ]
+}
+
+@test "./app conf list" {
+ i=env-a
+ n=app-a
+
+ mkzip "app-a"
+ app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n $n -i $i -v 1.0
+ [ $status -eq 0 ]
+
+ app -n $n -i $i conf; echo_lines
+ [ $status -eq 0 ]
+ [ "$output" = "app.bin bin/app-a " ]
+
+ app -n $n -i $i conf list; echo_lines
+ [ $status -eq 0 ]
+ [ "$output" = "app.bin bin/app-a " ]
+
+ app -n $n -i $i conf list foo; echo_lines
+ [ $status -eq 1 ]
+}
+
+@test "./app conf set" {
+ i=env-a
+ n=app-a
+
+ mkzip "app-a"
+ app instance install -r file -u $BATS_TEST_DIRNAME/data/app-a.zip -n $n -i $i -v 1.0
+ [ $status -eq 0 ]
+
+ app -n $n -i $i conf set group; echo_lines
+ [ $status -eq 1 ]
+
+ app -n $n -i $i conf set group.foo; echo_lines
+ [ $status -eq 1 ]
+
+ app -n $n -i $i conf set group.foo bar; echo_lines
+ [ $status -eq 0 ]
+}