From 5dd16e14dd41f1565687142ba7cefa7c4cf64658 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 12 Nov 2013 13:39:41 +0100 Subject: wip --- test/appstore-server-sync.bats | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/appstore-server-sync.bats (limited to 'test/appstore-server-sync.bats') diff --git a/test/appstore-server-sync.bats b/test/appstore-server-sync.bats new file mode 100644 index 0000000..7295f3d --- /dev/null +++ b/test/appstore-server-sync.bats @@ -0,0 +1,48 @@ +#!/usr/bin/env bats +# vim: set filetype=sh: + +load utils + +@test "Full test" { + cd $BATS_TMPDIR + rm -rf appstore-server-sync + mkdir -p appstore-server-sync/{repos,appstores,wc} + cd appstore-server-sync + + appstore server-init `pwd`/{repos,appstores} my-store + + git clone repos/my-store wc + cd wc + git config user.name "Test Case" + git config user.email tester@example.org + appstore add-app app-a file $BATS_TEST_DIRNAME/data/my-app.zip 1.0-SNAPSHOT disabled + git commit -a -m wip + cd .. + + appstore server-sync `pwd`/wc `pwd`/appstores/my-store + + # Check that the installed conf matches the one from the app + ( + cd appstores/my-store + app cat-conf -g my-app -f app-a/.app/config + eq '${lines[0]}' "my-app.awesome=true" + eq '${#lines[*]}' 1 + ) + + # Add some configuration to be merged into the app + ( + cd wc + echo my-app.extra=true >> app-a.config + git commit -a -m "extra config" + ) + + appstore server-sync `pwd`/wc `pwd`/appstores/my-store + + ( + cd appstores/my-store + app cat-conf -g my-app -f app-a/.app/config + eq '${lines[0]}' "my-app.awesome=true" + eq '${lines[1]}' "my-app.extra=true" + eq '${#lines[*]}' 2 + ) +} -- cgit v1.2.3