dotfiles/.config/shell/login.d/test/env-wiki-root.bats
2019-12-04 17:01:15 +01:00

23 lines
453 B
Bash

setup() {
testfile="$BATS_TEST_DIRNAME/../env-wiki-root.sh"
}
teardown() {
export WIKIROOT=""
}
@test "Populates WIKIROOT environment variable" {
source $testfile
[ -n "$WIKIROOT" ]
}
@test "Sets WIKIROOT to correct default path" {
source $testfile
[ "$WIKIROOT" = "$HOME/documents/notes" ]
}
@test "Leaves WIKIROOT as is if it is already set" {
export WIKIROOT="MY/CUSTOM/DIR"
source $testfile
[ "$WIKIROOT" = "MY/CUSTOM/DIR" ]
}