#!/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 ) }