aboutsummaryrefslogtreecommitdiff
path: root/test/app-conf.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/app-conf.bats')
-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 ]
+}