fisher/test/install.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

45 lines
1.2 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 --quiet
fisher install https://github.com/foobar --quiet
fisher install $DIRNAME/fixtures/plugins/baz --quiet
end
function -S teardown
rm -rf $path
source $DIRNAME/helpers/config-mock-teardown.fish
end
test "$TESTNAME - Install given plugins by name, url or path plugins"
(ls $fisher_cache) = foo bar baz foobar
end
test "$TESTNAME - Local paths are installed as symbolic links"
-L $path/config/cache/baz
end
for file in cache completions conf.d functions man fishfile key_bindings.fish
test "$TESTNAME - Add plugin $file to \$fisher_config/$file"
-e $path/config/$file
end
end
test "$TESTNAME - Append installed plugins to fishfile"
foo bar foobar baz = (
cat $path/config/fishfile
)
end
test "$TESTNAME - Add plugin key bindings to key_bindings.fish"
"##foobar## ##foobar##" = (cat $path/config/key_bindings.fish | xargs)
end
test "$TESTNAME - cache/.index is a copy of the URL in \$fisher_index"
(cat $path/config/cache/.index) = (cat $DIRNAME/fixtures/plugins/index)
end