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

27
test/deactivate.bats Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bats
load test_helper
setup() {
export PYENV_ROOT="${TMP}/pyenv"
}
@test "deactivate virtualenv" {
PYENV_SHELL="bash" run pyenv-sh-deactivate
assert_success
assert_output <<EOS
declare -f deactivate 1>/dev/null 2>&1 && deactivate
pyenv shell --unset
EOS
}
@test "deactivate virtualenv (fish)" {
PYENV_SHELL="fish" run pyenv-sh-deactivate
assert_success
assert_output <<EOS
functions -q deactivate; and deactivate
pyenv shell --unset
EOS
}