#!/usr/bin/env bats load test_helper setup() { export HOME="${TMP}" export PYENV_ROOT="${TMP}/pyenv" unset PYENV_VERSION unset PYENV_ACTIVATE_SHELL unset PYENV_VIRTUAL_ENV unset VIRTUAL_ENV unset CONDA_DEFAULT_ENV unset PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME unset PYENV_VIRTUALENV_VERBOSE_ACTIVATE unset PYENV_VIRTUALENV_DISABLE_PROMPT unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT unset VIRTUAL_ENV_DISABLE_PROMPT unset PYENV_VIRTUALENV_PROMPT unset _OLD_VIRTUAL_PS1 stub pyenv-hooks "activate : echo" } teardown() { unstub pyenv-hooks } @test "activate conda root from current version" { export PYENV_VIRTUALENV_INIT=1 setup_conda "anaconda-2.3.0" stub pyenv-version-name "echo anaconda-2.3.0" stub pyenv-virtualenv-prefix "anaconda-2.3.0 : echo \"${PYENV_ROOT}/versions/anaconda-2.3.0\"" stub pyenv-prefix "anaconda-2.3.0 : echo \"${PYENV_ROOT}/versions/anaconda-2.3.0\"" stub pyenv-sh-deactivate "--force --quiet : echo deactivated" PYENV_SHELL="bash" PYENV_VERSION="anaconda-2.3.0" run pyenv-sh-activate assert_success assert_output <