abra/tests/integration/dirs.bats
decentral1se addbda9145
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
test: fixups for the changepocalypse
2024-07-09 09:41:49 +02:00

43 lines
957 B
Bash

#!/usr/bin/env bash
setup(){
load "$PWD/tests/integration/helpers/common"
_common_setup
if [[ -d "$ABRA_DIR" ]]; then
rm -rf "$ABRA_DIR"
fi
}
@test "ABRA_DIR is overriden" {
ABRA_DIR="$HOME/.abra_foo"
run $ABRA app ls
# no servers yet, so will fail. however, it will run the required code which
# checks if it should create these base directories and that is what we want
assert_failure
assert_exists "$HOME/.abra_foo"
run rm -rf "$ABRA_DIR"
assert_success
}
@test "abra directory is created" {
run $ABRA app ls
# NOTE(d1): no servers yet, so will fail. however, it will run the required
# code which checks if it should create these base directories and that is
# what we want
assert_failure
assert_exists "$ABRA_DIR"
assert_exists "$ABRA_DIR/servers"
assert_exists "$ABRA_DIR/recipes"
assert_exists "$ABRA_DIR/backups"
assert_exists "$ABRA_DIR/vendor"
assert_not_exists "$ABRA_DIR/catalogue"
}