activate: look for a conda environment if given name is not a pyenv's prefix

This commit is contained in:
Yamashita, Yuu
2015-07-19 03:38:48 +09:00
parent be6701e7b6
commit 25395f0331
3 changed files with 34 additions and 10 deletions

View File

@@ -11,20 +11,22 @@ load test_helper
@test "detect parent shell from script (sh)" {
unset PYENV_SHELL
printf '#!/bin/sh\necho "$(pyenv-virtualenv-init -)"' > ${BATS_TEST_DIRNAME}/script.sh
chmod +x ${BATS_TEST_DIRNAME}/script.sh
run ${BATS_TEST_DIRNAME}/script.sh
printf '#!/bin/sh\necho "$(pyenv-virtualenv-init -)"' > "${TMP}/script.sh"
chmod +x ${TMP}/script.sh
run ${TMP}/script.sh
assert_success
assert_output_contains_not ' PROMPT_COMMAND="_pyenv_virtualenv_hook;$PROMPT_COMMAND";'
rm -f "${TMP}/script.sh"
}
@test "detect parent shell from script (bash)" {
unset PYENV_SHELL
printf '#!/bin/bash\necho "$(pyenv-virtualenv-init -)"' > ${BATS_TEST_DIRNAME}/script.sh
chmod +x ${BATS_TEST_DIRNAME}/script.sh
run ${BATS_TEST_DIRNAME}/script.sh
printf '#!/bin/bash\necho "$(pyenv-virtualenv-init -)"' > "${TMP}/script.sh"
chmod +x ${TMP}/script.sh
run ${TMP}/script.sh
assert_success
assert_output_contains ' PROMPT_COMMAND="_pyenv_virtualenv_hook;$PROMPT_COMMAND";'
rm -f "${TMP}/script.sh"
}
@test "sh-compatible instructions" {