You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fisher/test/plugin-walk-functions.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