fisher/test/update.fish
Jorge Bucaran 707855203a Ahoy! Fisherman gets a super patch v0.3.1
This patch contains several amends for 0.3.0 and
other minor documentation corrections.  Major
documentation revision and rewrite.

fisher help shows fisher(1) by default now.

Fix a critical bug that was causing fisher uninstall
--force to remove not the symbolic link, but the
actual files. Closes #24

Rename orphan tag to custom for plugins installed
using a custom URL.

warning Remove fisher --link flag and create symbolic
links by default for local paths. The user does not
have to worry about symbolic links or whether the
copy is as symbolic link or not anymore. If the user
tries to install a local path, then the best thing
to do is to create a symbolic link. This also
eliminates the need to call update.

warning Remove fisher --cache and fisher --validate.
Now, that these options are separated into their own
function and they are intentionally private, there
is no need for them.
2016-01-10 16:13:46 +09:00

57 lines
1.3 KiB
Fish

source $DIRNAME/helpers/fisher_mock_repos.fish
source $DIRNAME/helpers/fisher_mock_index.fish
source $DIRNAME/helpers/fisher_mock_config.fish
set -l path $DIRNAME/$TESTNAME.test(random)
set -l source $DIRNAME/fixtures/source
set -l source2 $path/source
set -l index $path/INDEX
set -l names foo bar baz
set -l names2 norf
function -S setup
mkdir -p $path
fisher_mock_repos $source/*
fisher_mock_index $source $names > $index
fisher_mock_config $path $index
mkdir -p $fisher_cache
for name in $names
cp -rf $source/$name $fisher_cache
end
mkdir -p $source2
cp -rf $source $path
for name in $names
set -l file $source2/$name/$name.fish
sed "s/echo $name/echo $name v2/" $file > $file.tmp
mv $file.tmp $file
fisher_mock_repos $source2/$name
git -C $fisher_cache/$name remote add origin file://$source2/$name
end
fisher_mock_index $source $names $names2 > $index
end
function -S teardown
rm -rf $path
rm -rf $source/{$names}/.git
end
for name in $names
test "update <$name> in cache" (
fisher update $name -q
eval $name) = "$name v2"
end
end
test "update index"
(fisher update --index; cat $fisher_config/cache/.index) = (cat $index)
end