fisher/test/uninstall.fish
Jorge Bucaran 7de51e7436 Remove scripts directory in favor functions/ or root/
Remove scripts directory in favor of using the functions/ or root
for sharing scripts. Using a scripts directory does not solve the
main problem of sharing scripts with the same name, so this addition
was deemed of little value. In the future, a more robust way to avoid
name collisions when sharing scripts would be nice to have, but at
the moment having a scripts directory is not solving this problem
but just adding clutter to the configuration.

Closes #105.
2016-02-18 06:42:12 +09:00

47 lines
1.1 KiB
Fish

set -l path $DIRNAME/.t-$TESTNAME-(random)
function -S setup
mkdir -p $path/config/cache
source $DIRNAME/helpers/config-mock.fish $path/config
fisher install foo bar foobar --quiet
fisher uninstall foo --quiet
fisher uninstall foobar --quiet --force
end
function -S teardown
rm -rf $path
source $DIRNAME/helpers/config-mock-teardown.fish
end
for plugin in foo foobar
test "$TESTNAME - Uninstall a plugin ($plugin)"
! -f $path/config/functions/$plugin.fish
end
end
test "$TESTNAME - Remove plugin from fishfile"
bar = (cat $fisher_file)
end
test "$TESTNAME - *Do not* remove from cache unless --force is used"
-d $fisher_cache/foo
end
test "$TESTNAME - Remove plugin from cache using --force is used"
! -e $fisher_cache/foobar
end
test "$TESTNAME - Remove plugin key bindings from key_bindings.fish"
-z (cat $path/config/key_bindings.fish | xargs)
end
test "$TESTNAME - Remove plugin \$fisher_config/completions"
! -e $path/config/completions/foobar.fish
end
test "$TESTNAME - Remove plugin startup configuration from \$fisher_config/conf.d"
! -e $path/config/conf.d/conf.fish
end