Change prompt after activate (#52)

This commit is contained in:
Yamashita, Yuu
2015-11-09 00:34:56 +00:00
parent c1b9238cbe
commit ee18ffac9f
6 changed files with 101 additions and 15 deletions

View File

@@ -5,6 +5,8 @@ load test_helper
setup() {
export HOME="${TMP}"
export PYENV_ROOT="${TMP}/pyenv"
unset _OLD_VIRTUAL_PYTHONHOME
unset _OLD_VIRTUAL_PS1
}
@test "activate conda root from current version" {
@@ -23,10 +25,14 @@ setup() {
assert_success
assert_output <<EOS
false
pyenv-virtualenv: activate anaconda-2.3.0
unset PYENV_DEACTIVATE;
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0";
export CONDA_DEFAULT_ENV="root";
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(anaconda-2.3.0) \${PS1}";
EOS
}
@@ -46,10 +52,12 @@ EOS
assert_success
assert_output <<EOS
false
pyenv-virtualenv: activate anaconda-2.3.0
set -e PYENV_DEACTIVATE;
setenv VIRTUAL_ENV "${TMP}/pyenv/versions/anaconda-2.3.0";
setenv CONDA_DEFAULT_ENV "root";
pyenv-virtualenv: prompt changing not work for fish.
EOS
}
@@ -68,12 +76,16 @@ EOS
assert_success
assert_output <<EOS
false
pyenv-virtualenv: activate miniconda-3.9.1
export PYENV_VERSION="miniconda-3.9.1";
export PYENV_ACTIVATE_SHELL=1;
unset PYENV_DEACTIVATE;
export VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1";
export CONDA_DEFAULT_ENV="root";
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(miniconda-3.9.1) \${PS1}";
EOS
}
@@ -93,10 +105,14 @@ EOS
assert_success
assert_output <<EOS
false
pyenv-virtualenv: activate anaconda-2.3.0/envs/foo
unset PYENV_DEACTIVATE;
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo";
export CONDA_DEFAULT_ENV="foo";
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(anaconda-2.3.0/envs/foo) \${PS1}";
EOS
}
@@ -115,11 +131,15 @@ EOS
assert_success
assert_output <<EOS
false
pyenv-virtualenv: activate miniconda-3.9.1/envs/bar
export PYENV_VERSION="miniconda-3.9.1/envs/bar";
export PYENV_ACTIVATE_SHELL=1;
unset PYENV_DEACTIVATE;
export VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar";
export CONDA_DEFAULT_ENV="bar";
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(miniconda-3.9.1/envs/bar) \${PS1}";
EOS
}