forked from toolshed/abra
test: moar integration tests [ci skip]
This commit is contained in:
@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
setup(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
|
||||
if [[ -d "$ABRA_DIR" ]]; then
|
||||
rm -rf "$ABRA_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
@test "ABRA_DIR can be overriden" {
|
||||
@test "ABRA_DIR is overriden" {
|
||||
ABRA_DIR="$HOME/.abra_foo"
|
||||
|
||||
run $ABRA app ls
|
||||
@ -15,22 +18,25 @@ setup() {
|
||||
# checks if it should create these base directories and that is what we want
|
||||
assert_failure
|
||||
|
||||
assert [ -d "$HOME/.abra_foo" ]
|
||||
assert_exists "$HOME/.abra_foo"
|
||||
|
||||
run rm -rf "$ABRA_DIR"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "abra directories created" {
|
||||
@test "abra directory is created" {
|
||||
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 [ -d "$ABRA_DIR" ]
|
||||
assert [ -d "$ABRA_DIR/servers" ]
|
||||
assert [ -d "$ABRA_DIR/recipes" ]
|
||||
assert [ -d "$ABRA_DIR/backups" ]
|
||||
assert [ -d "$ABRA_DIR/vendor" ]
|
||||
assert [ -d "$ABRA_DIR/catalogue" ]
|
||||
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_exists "$ABRA_DIR/catalogue"
|
||||
}
|
||||
|
||||
@test "catalogue recipe is a git repository" {
|
||||
@ -42,10 +48,6 @@ setup() {
|
||||
|
||||
assert_output --partial 'local recipe catalogue is missing'
|
||||
|
||||
assert [ -d "$ABRA_DIR/catalogue" ]
|
||||
assert [ -d "$ABRA_DIR/catalogue/.git" ]
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
assert_exists "$ABRA_DIR/catalogue"
|
||||
assert_exists "$ABRA_DIR/catalogue/.git"
|
||||
}
|
||||
|
Reference in New Issue
Block a user