Skip to content

Commit

Permalink
Add basic test for rehash wait
Browse files Browse the repository at this point in the history
  • Loading branch information
yyuu committed Apr 24, 2018
1 parent 7973e59 commit 1ec57a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/rehash.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ create_executable() {
assert_failure "pyenv: cannot rehash: ${PYENV_ROOT}/shims/.pyenv-shim exists"
}

@test "wait until lock acquisition" {
export PYENV_REHASH_TIMEOUT=5
mkdir -p "${PYENV_ROOT}/shims"
touch "${PYENV_ROOT}/shims/.pyenv-shim"
bash -c "sleep 1 && rm -f ${PYENV_ROOT}/shims/.pyenv-shim" &
run pyenv-rehash
assert_success
}

@test "creates shims" {
create_executable "2.7" "python"
create_executable "2.7" "fab"
Expand Down

0 comments on commit 1ec57a0

Please sign in to comment.