Add tests for activate and deactivate

This commit is contained in:
Yamashita Yuu
2014-01-21 00:37:33 +09:00
parent 802cd6b2fa
commit d0685addc1
3 changed files with 119 additions and 5 deletions

View File

@@ -20,6 +20,11 @@ if [ "$1" = "--complete" ]; then
exec pyenv-virtualenvs --bare
fi
if [ "$1" = "--unset" ]; then
echo "pyenv deactivate"
exit
fi
versions=("$@")
shell="$(basename "${PYENV_SHELL:-$SHELL}")"
@@ -29,11 +34,6 @@ if [ -z "$versions" ]; then
IFS="$OLDIFS"
fi
if [ "$1" = "--unset" ]; then
echo "pyenv deactivate"
exit
fi
if [ "${#versions[@]}" -gt 1 ]; then
echo "pyenv-virtualenv: cannot activate multiple versions at once: ${versions[@]}" 1>&2
exit 1