Disable all command and test case

pull/974/head
Nils Winkler 2017-05-10 11:12:05 +02:00
parent 098186754c
commit 65c6e6a1a6
2 changed files with 18 additions and 0 deletions

View File

@ -238,6 +238,9 @@ _disable-thing ()
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin) rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi fi
if [ -e $BASH_IT/$subdirectory/enabled/*$BASH_IT_LOAD_PRIORITY_SEPARATOR$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/*$BASH_IT_LOAD_PRIORITY_SEPARATOR$(basename $plugin)
fi
done done
else else
# Use a glob to search for both possible patterns # Use a glob to search for both possible patterns

View File

@ -91,6 +91,21 @@ function __setup_plugin_tests {
[ "$available" == "$enabled" ] [ "$available" == "$enabled" ]
} }
@test "disable all plugins" {
__setup_plugin_tests
run _enable-plugin "all"
local available=$(find $BASH_IT/plugins/available -name *.plugin.bash | wc -l)
local enabled=$(find $BASH_IT/plugins/enabled -name 2*.plugin.bash | wc -l)
echo "Available: $available, Enabled: $enabled"
[ "$available" == "$enabled" ]
run _disable-plugin "all"
local enabled2=$(find $BASH_IT/plugins/enabled -name *.plugin.bash | wc -l)
echo "Enabled: $enabled2"
[ "$enabled2" -eq 0 ]
}
@test "describe the nvm plugin without enabling it" { @test "describe the nvm plugin without enabling it" {
__setup_plugin_tests __setup_plugin_tests