mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
27 lines
649 B
Bash
Executable file
27 lines
649 B
Bash
Executable file
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
|
|
@test "empty rehash" {
|
|
assert [ ! -d "${RBENV_ROOT}/shims" ]
|
|
run rbenv-rehash
|
|
assert_success
|
|
assert [ -d "${RBENV_ROOT}/shims" ]
|
|
rmdir "${RBENV_ROOT}/shims"
|
|
}
|
|
|
|
@test "non-writable shims directory" {
|
|
mkdir -p "${RBENV_ROOT}/shims"
|
|
chmod -w "${RBENV_ROOT}/shims"
|
|
run rbenv-rehash
|
|
assert_failure
|
|
assert_output "rbenv: cannot rehash: ${RBENV_ROOT}/shims isn't writable"
|
|
}
|
|
|
|
@test "rehash in progress" {
|
|
mkdir -p "${RBENV_ROOT}/shims"
|
|
touch "${RBENV_ROOT}/shims/.rbenv-shim"
|
|
run rbenv-rehash
|
|
assert_failure
|
|
assert_output "rbenv: cannot rehash: ${RBENV_ROOT}/shims/.rbenv-shim exists"
|
|
}
|