fisher/test/fisher.fish
Jorge Bucaran 2cbbb00dcb Fisherman 1.0 RC
* Deprecate fisher --list in favor of a new command fisher list.
  The behavior is roughly the same. See fisher help list for
  usage. tl;dr: Use list to query the local system / cache and
  search to query the index.

* Teach fisher_plugin_walk about fish_postexec,
  fish_command_not_found and fish_preexec event emitters and
  erase them during uninstall if they were defined in a snippet.

* Fisherman now recognizes the following aliases by default:
  i for install, u for update, l for list, s for search and h
  for help.

* Large documentation rewrite. Better, simpler, more concise
  and more consistent.

* Fisherman now detects if users have modified their fish
  prompt using fish_config and if so, uninstalls $fisher_prompt.
2016-02-29 23:13:29 +09:00

46 lines
1.2 KiB
Fish

set -l mock_command awk
function -S setup
set -g fisher_alias "$mock_command=A,B"
function fisher_$mock_command
if not set -q argv[1]
echo Usage:...
return 1
end
awk $argv
end
end
function -S teardown
functions -e fisher_$mock_command
end
test "$TESTNAME - Evaluate fisher_ (sub) commands"
(fisher $mock_command) = Usage:...
end
test "$TESTNAME - Commands can read standard input"
(echo "foo bar baz" | fisher $mock_command '{ print $2 }' | xargs) = "bar"
end
test "$TESTNAME - Display version information"
(fisher --version | cut -d " " -f3) = (sed 1q $fisher_home/VERSION)
end
test "$TESTNAME - Handle \$fisher_alias aliases"
(fisher A; fisher B) = (fisher $mock_command; fisher $mock_command)
end
test "$TESTNAME - Display usage help"
(fisher | sed 1q) = "Usage: fisher <command> [<arguments>] [--help] [--version]"
end
test "$TESTNAME - Display basic information help info about 'help'"
(fisher | tail -n2 | xargs) = "Use fisher help -g to list guides and other documentation. See fisher help <command or concept> to access a man page."
end
test "$TESTNAME - Display basic information about available commands"
(fisher | sed -E 's/ +//' | grep "^$mock_command\$")
end