2019-07-27 11:42:54 +00:00
|
|
|
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
|
2019-12-04 16:01:15 +00:00
|
|
|
[ "$WIKIROOT" = "$HOME/documents/notes" ]
|
2019-07-27 11:42:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "Leaves WIKIROOT as is if it is already set" {
|
|
|
|
export WIKIROOT="MY/CUSTOM/DIR"
|
|
|
|
source $testfile
|
|
|
|
[ "$WIKIROOT" = "MY/CUSTOM/DIR" ]
|
|
|
|
}
|