Add tests for base theme's battery functions
parent
0aad8b4ab0
commit
b55c0251ed
2
test/run
2
test/run
|
|
@ -9,4 +9,4 @@ if [ -z "${BASH_IT}" ]; then
|
|||
export BASH_IT=$(cd ${test_directory} && dirname $(pwd))
|
||||
fi
|
||||
|
||||
exec $bats_executable ${CI:+--tap} ${test_directory}/{install,lib,plugins}
|
||||
exec $bats_executable ${CI:+--tap} ${test_directory}/{install,lib,plugins,themes}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/env bats
|
||||
|
||||
load ../test_helper
|
||||
load ../../lib/composure
|
||||
load ../../plugins/available/base.plugin
|
||||
load ../../themes/base.theme
|
||||
|
||||
@test 'themes base: battery_percentage should not exist' {
|
||||
run type -a battery_percentage &> /dev/null
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test 'themes base: battery_percentage should exist if battery plugin loaded' {
|
||||
load ../../plugins/available/battery.plugin
|
||||
|
||||
run type -a battery_percentage &> /dev/null
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test 'themes base: battery_char should exist' {
|
||||
run type -a battery_char &> /dev/null
|
||||
assert_success
|
||||
|
||||
run battery_char
|
||||
assert_success
|
||||
assert_line "0" ""
|
||||
|
||||
run type -a battery_char
|
||||
assert_line " echo -n"
|
||||
}
|
||||
|
||||
@test 'themes base: battery_char should exist if battery plugin loaded' {
|
||||
unset -f battery_char
|
||||
load ../../plugins/available/battery.plugin
|
||||
load ../../themes/base.theme
|
||||
|
||||
run type -a battery_char &> /dev/null
|
||||
assert_success
|
||||
|
||||
run battery_char
|
||||
assert_success
|
||||
|
||||
run type -a battery_char
|
||||
assert_line ' if [[ "${THEME_BATTERY_PERCENTAGE_CHECK}" = true ]]; then'
|
||||
}
|
||||
|
||||
@test 'themes base: battery_charge should exist' {
|
||||
run type -a battery_charge &> /dev/null
|
||||
assert_success
|
||||
|
||||
run battery_charge
|
||||
assert_success
|
||||
assert_line "0" ""
|
||||
}
|
||||
|
||||
@test 'themes base: battery_charge should exist if battery plugin loaded' {
|
||||
unset -f battery_charge
|
||||
load ../../plugins/available/battery.plugin
|
||||
load ../../themes/base.theme
|
||||
|
||||
run type -a battery_charge &> /dev/null
|
||||
assert_success
|
||||
|
||||
run battery_charge
|
||||
assert_success
|
||||
|
||||
run type -a battery_charge
|
||||
assert_line ' no)'
|
||||
}
|
||||
Loading…
Reference in New Issue