mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-09 07:10:27 +00:00
33 lines
811 B
Fish
33 lines
811 B
Fish
|
set -l path $DIRNAME/.t-$TESTNAME-(random)
|
||
|
|
||
|
function -S setup
|
||
|
mkdir -p $path/foo/functions/nest
|
||
|
|
||
|
touch $path/foo/foo.fish
|
||
|
touch $path/foo/functions/{bar,baz,nest/norf}.fish
|
||
|
|
||
|
# foo
|
||
|
# |--foo.fish
|
||
|
# |--functions
|
||
|
# |--bar.fish
|
||
|
# |--baz.fish
|
||
|
# |--nest
|
||
|
# |--norf.fish
|
||
|
end
|
||
|
|
||
|
function -S teardown
|
||
|
rm -rf $path
|
||
|
end
|
||
|
|
||
|
test "$TESTNAME - Evaluate every fish file inside functions/*"
|
||
|
(__fisher_plugin_walk foo $path/foo | awk '{ print $1 }') = --source
|
||
|
end
|
||
|
|
||
|
test "$TESTNAME - Move ( <plugin>/{,functions/}*.fish ) TO ( functions/* )"
|
||
|
(__fisher_plugin_walk foo $path/foo | awk '{ print $3 }' | sed 's|[^/]*$||') = "functions/"
|
||
|
end
|
||
|
|
||
|
test "$TESTNAME - Get function names"
|
||
|
(__fisher_plugin_walk foo $path/foo | awk '{ print $4 }') = foo bar baz norf
|
||
|
end
|