From d8890e75cf83504320ad12b657112cd5347fb600 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 17 Oct 2012 15:20:45 +0200 Subject: o Reworking conf to work as documented. Adding test case. --- test/app-conf.bats | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100755 test/app-conf.bats (limited to 'test') 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 ] +} -- cgit v1.2.3