test/theme: adopt newly revamped `setup()`
parent
b686515877
commit
f0dfe1a67f
|
|
@ -1,8 +1,11 @@
|
||||||
#!/usr/bin/env bats
|
# shellcheck shell=bats
|
||||||
|
|
||||||
load ../test_helper
|
load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"
|
||||||
load ../test_helper_libs
|
|
||||||
load ../../themes/base.theme
|
function local_setup_file() {
|
||||||
|
setup_libs "colors" #"theme"
|
||||||
|
load "${BASH_IT?}/themes/base.theme.bash"
|
||||||
|
}
|
||||||
|
|
||||||
@test 'themes base: battery_percentage should not exist' {
|
@test 'themes base: battery_percentage should not exist' {
|
||||||
run type -a battery_percentage &> /dev/null
|
run type -a battery_percentage &> /dev/null
|
||||||
|
|
@ -10,7 +13,7 @@ load ../../themes/base.theme
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'themes base: battery_percentage should exist if battery plugin loaded' {
|
@test 'themes base: battery_percentage should exist if battery plugin loaded' {
|
||||||
load ../../plugins/available/battery.plugin
|
load "${BASH_IT?}/plugins/available/battery.plugin.bash"
|
||||||
|
|
||||||
run type -a battery_percentage &> /dev/null
|
run type -a battery_percentage &> /dev/null
|
||||||
assert_success
|
assert_success
|
||||||
|
|
@ -28,12 +31,12 @@ load ../../themes/base.theme
|
||||||
@test 'themes base: battery_char should exist if battery plugin loaded' {
|
@test 'themes base: battery_char should exist if battery plugin loaded' {
|
||||||
unset -f battery_char
|
unset -f battery_char
|
||||||
|
|
||||||
load ../../plugins/available/battery.plugin
|
load "${BASH_IT?}/plugins/available/battery.plugin.bash"
|
||||||
run type -t battery_percentage
|
run type -t battery_percentage
|
||||||
assert_success
|
assert_success
|
||||||
assert_line "function"
|
assert_line "function"
|
||||||
|
|
||||||
load ../../themes/base.theme
|
load "${BASH_IT?}/themes/base.theme.bash"
|
||||||
run type -t battery_char
|
run type -t battery_char
|
||||||
assert_success
|
assert_success
|
||||||
assert_line "function"
|
assert_line "function"
|
||||||
|
|
@ -51,13 +54,13 @@ load ../../themes/base.theme
|
||||||
|
|
||||||
run battery_charge
|
run battery_charge
|
||||||
assert_success
|
assert_success
|
||||||
assert_line -n 0 ""
|
assert_output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@test 'themes base: battery_charge should exist if battery plugin loaded' {
|
@test 'themes base: battery_charge should exist if battery plugin loaded' {
|
||||||
unset -f battery_charge
|
unset -f battery_charge
|
||||||
load ../../plugins/available/battery.plugin
|
load "${BASH_IT?}/plugins/available/battery.plugin.bash"
|
||||||
load ../../themes/base.theme
|
load "${BASH_IT?}/themes/base.theme.bash"
|
||||||
|
|
||||||
run type -a battery_charge &> /dev/null
|
run type -a battery_charge &> /dev/null
|
||||||
assert_success
|
assert_success
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
#!/usr/bin/env bats
|
# shellcheck shell=bats
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
|
||||||
load ../test_helper
|
load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"
|
||||||
load ../test_helper_libs
|
|
||||||
load ../../themes/githelpers.theme
|
function local_setup_file() {
|
||||||
load ../../themes/base.theme
|
setup_libs "colors" #"theme"
|
||||||
|
load "${BASH_IT?}/themes/base.theme.bash"
|
||||||
|
load "${BASH_IT?}/themes/githelpers.theme.bash"
|
||||||
|
}
|
||||||
|
|
||||||
add_commit() {
|
add_commit() {
|
||||||
local file_name="general-${RANDOM}"
|
local file_name="general-${RANDOM}"
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,10 @@
|
||||||
#!/usr/bin/env bats
|
# shellcheck shell=bats
|
||||||
|
|
||||||
load ../test_helper
|
load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"
|
||||||
load ../test_helper_libs
|
|
||||||
|
|
||||||
function local_setup {
|
function local_setup_file() {
|
||||||
setup_test_fixture
|
setup_libs "colors" #"theme"
|
||||||
|
load "${BASH_IT?}/themes/base.theme.bash"
|
||||||
# Copy the test fixture to the Bash-it folder
|
|
||||||
if command -v rsync &> /dev/null
|
|
||||||
then
|
|
||||||
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
|
|
||||||
|
|
||||||
export OLD_PATH="$PATH"
|
|
||||||
|
|
||||||
load ../../themes/base.theme
|
|
||||||
}
|
|
||||||
|
|
||||||
function local_teardown {
|
|
||||||
export PATH="$OLD_PATH"
|
|
||||||
unset OLD_PATH
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_repo {
|
function setup_repo {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue