From 1480338c5a3da5b6494565ab955ab67a15f19dd3 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 31 Oct 2013 21:52:24 +0100 Subject: app-init: Adding '-s' option to set a configuration option before the resolver is executed and app is installed. The configuration will be available when the app's hooks are executed. o Running the documentation though aspell. --- test/app-init.bats | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'test/app-init.bats') diff --git a/test/app-init.bats b/test/app-init.bats index 8ffe1b6..2b5d724 100755 --- a/test/app-init.bats +++ b/test/app-init.bats @@ -3,20 +3,22 @@ load utils -#@test "Invalid resolver" { -# app init -d my-app wat; echo_lines -# eq '$status' 1 -# eq '${#lines[*]}' 1 -# eq '${lines[0]}' "No such resolver: wat" -#} +@test "Invalid resolver" { + check_status=no + app init -d my-app wat + eq '$status' 1 + eq '${#lines[*]}' 1 + eq '${lines[0]}' "No such resolver: wat" +} -#@test "Already installed" { -# mkdir -p my-app/.apps -# app init -d my-app maven; echo_lines -# eq '$status' 1 -# eq '${#lines[*]}' 1 -# match '${lines[0]}' "my-app" -#} +@test "Already installed" { + mkdir -p my-app/.app + check_status=no + app init -d my-app maven + eq '$status' 1 + eq '${#lines[*]}' 1 + match '${lines[0]}' "my-app" +} @test "Happy day" { mkzip app-a @@ -74,3 +76,17 @@ load utils match '${lines[0]}' ".*/versions/1.0/root$" eq '${#lines[*]}' 1 } + +@test "app-init: Can pass configuration variables" { + mkzip app-a + app init -d my-app \ + -s "foo.bar=awesome" \ + -s "foo.baz=i love space" \ + -s "foo.wat=2+2=5" file $APPSH_HOME/test/data/app-a.zip + cd my-app + app cat-conf -g foo + match '${lines[0]}' "foo.bar=awesome" + match '${lines[1]}' "foo.baz=i love space" + match '${lines[2]}' "foo.wat=2\+2=5" + eq '${#lines[*]}' 3 +} -- cgit v1.2.3