dots2/.antidote/tests/test_cmd_path.md

948 B

antidote path tests

Setup

% source ./tests/_setup.zsh
% source ./antidote.zsh
%

Path Command

antidote-path prints path to bundle.

% antidote path foo/bar &>/dev/null  #=> --exit 0
% antidote path foo/bar | subenv ANTIDOTE_HOME
$ANTIDOTE_HOME/foo/bar
%

antidote-path fails on missing bundles

% antidote path bar/foo &>/dev/null  #=> --exit 1
% antidote path bar/foo; err=$?
antidote: error: bar/foo does not exist in cloned paths
% echo $err
1
%

antidote-path accepts piped input

% antidote list -s | antidote path | sort | subenv ANTIDOTE_HOME
$ANTIDOTE_HOME/foo/bar
$ANTIDOTE_HOME/foo/baz
$ANTIDOTE_HOME/foo/qux
$ANTIDOTE_HOME/getantidote/zsh-defer
$ANTIDOTE_HOME/ohmy/ohmy
%

antidote-path expands vars

% ZSH_CUSTOM=$ZDOTDIR/custom
% antidote path '$ZSH_CUSTOM/plugins/myplugin' | subenv
$HOME/.zsh/custom/plugins/myplugin
%

Teardown

% t_teardown
%