From cc7c9d22b50ce4ddaab037feefda0863218ebaed Mon Sep 17 00:00:00 2001 From: Tony Wang Date: Mon, 5 Jan 2015 23:28:14 +0800 Subject: [PATCH] fix failed tests running under fish --- test/activate.bats | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/test/activate.bats b/test/activate.bats index 8e6165f..995dcf1 100644 --- a/test/activate.bats +++ b/test/activate.bats @@ -123,7 +123,7 @@ EOS stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" - run pyenv-sh-activate "venv27" + PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" unstub pyenv-virtualenv-prefix unstub pyenv-prefix @@ -144,7 +144,7 @@ EOS stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" - run pyenv-sh-activate "venv27" + PYENV_SHELL="bash" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" unstub pyenv-virtualenv-prefix unstub pyenv-prefix @@ -159,6 +159,48 @@ export PYENV_ACTIVATE="${PYENV_ROOT}/versions/venv27"; EOS } +@test "activate virtualenv from command-line argument (fish)" { + export PYENV_VIRTUALENV_INIT=1 + + stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" + stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/venv27\"" + + PYENV_SHELL="fish" PYENV_VERSION="venv" run pyenv-sh-activate "venv27" + + unstub pyenv-virtualenv-prefix + unstub pyenv-prefix + + assert_success + assert_output <