test/helpers: adopt newly revamped `setup()`

pull/2031/head
John D Pell 2022-01-31 11:08:26 -08:00 committed by John D Pell
parent 425ef3e10a
commit 1ddec65d56
1 changed files with 8 additions and 14 deletions

22
test/lib/helpers.bats 100755 → 100644
View File

@ -1,21 +1,15 @@
#!/usr/bin/env bats # shellcheck shell=bats
load ../test_helper load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"
load ../test_helper_libs
load ../../plugins/available/base.plugin
load ../../lib/colors
function local_setup { function local_setup_file() {
setup_test_fixture setup_libs "colors"
load "${BASH_IT?}/plugins/available/base.plugin.bash"
}
function local_setup() {
# Copy the test fixture to the Bash-it folder # Copy the test fixture to the Bash-it folder
if command -v rsync &> /dev/null; then cp -RP "$BASH_IT/test/fixtures/bash_it"/* "$BASH_IT/"
rsync -a "$BASH_IT/test/fixtures/bash_it/" "$BASH_IT/"
else
find "$BASH_IT/test/fixtures/bash_it" \
-mindepth 1 -maxdepth 1 \
-exec cp -r {} "$BASH_IT/" \;
fi
} }
# TODO Create global __is_enabled function # TODO Create global __is_enabled function