Made setup function for _command_exists generic

This commit is contained in:
Nils Winkler
2017-10-19 07:37:19 +02:00
parent 28c41efcbc
commit b4c6029706

View File

@@ -7,10 +7,12 @@ cite _about _param _example _group _author _version
load ../../plugins/available/battery.plugin
function setup_command_exists_pmset {
function setup_command_exists {
success_command="$1"
function _command_exists {
case "$1" in
"pmset")
"${success_command}")
true
;;
*)
@@ -29,7 +31,7 @@ function setup_pmset {
}
@test 'plugins battery: battery-percentage with pmset, 100%' {
setup_command_exists_pmset
setup_command_exists "pmset"
setup_pmset "100%"
@@ -38,7 +40,7 @@ function setup_pmset {
}
@test 'plugins battery: battery-percentage with pmset, 98%' {
setup_command_exists_pmset
setup_command_exists "pmset"
setup_pmset "98%"
@@ -47,7 +49,7 @@ function setup_pmset {
}
@test 'plugins battery: battery-percentage with pmset, 98.5%' {
setup_command_exists_pmset
setup_command_exists "pmset"
setup_pmset "98.5%"
@@ -56,7 +58,7 @@ function setup_pmset {
}
@test 'plugins battery: battery-percentage with pmset, 4%' {
setup_command_exists_pmset
setup_command_exists "pmset"
setup_pmset "4%"