1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 14:23:53 -05:00

Merge pull request #636 from sstephenson/speedup-rehash

Speed up `rbenv rehash`
This commit is contained in:
Mislav Marohnić
2014-10-16 12:29:51 +02:00
2 changed files with 45 additions and 36 deletions

View File

@@ -53,7 +53,7 @@ ruby
OUT
}
@test "removes stale shims" {
@test "removes outdated shims" {
mkdir -p "${RBENV_ROOT}/shims"
touch "${RBENV_ROOT}/shims/oldshim1"
chmod +x "${RBENV_ROOT}/shims/oldshim1"
@@ -67,6 +67,25 @@ OUT
assert [ ! -e "${RBENV_ROOT}/shims/oldshim1" ]
}
@test "do exact matches when removing stale shims" {
create_executable "2.0" "unicorn_rails"
create_executable "2.0" "rspec-core"
rbenv-rehash
cp "$RBENV_ROOT"/shims/{rspec-core,rspec}
cp "$RBENV_ROOT"/shims/{rspec-core,rails}
cp "$RBENV_ROOT"/shims/{rspec-core,uni}
chmod +x "$RBENV_ROOT"/shims/{rspec,rails,uni}
run rbenv-rehash
assert_success ""
assert [ ! -e "${RBENV_ROOT}/shims/rails" ]
assert [ ! -e "${RBENV_ROOT}/shims/rake" ]
assert [ ! -e "${RBENV_ROOT}/shims/uni" ]
}
@test "binary install locations containing spaces" {
create_executable "dirname1 p247" "ruby"
create_executable "dirname2 preview1" "rspec"