1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

Stop using abs_dirname() in rbenv-init

It's slow and not necessary since we expect `$0` to already be expanded.

In tests this change forces us to deal with some relative paths, but
it's not a big deal. The `rbenv init -` output in the most common case
will be the same as before:

    source '/home/myuser/.rbenv/libexec/../completions/rbenv.bash'
This commit is contained in:
Mislav Marohnić
2014-01-04 16:37:20 +01:00
parent 5287e2ebf4
commit 8bac958994
2 changed files with 3 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ load test_helper
root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run rbenv-init - bash
assert_success
assert_line "source '${root}/libexec/../completions/rbenv.bash'"
assert_line "source '${root}/test/../libexec/../completions/rbenv.bash'"
}
@test "detect parent shell" {
@@ -35,7 +35,7 @@ load test_helper
root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run rbenv-init - fish
assert_success
assert_line ". '${root}/libexec/../completions/rbenv.fish'"
assert_line ". '${root}/test/../libexec/../completions/rbenv.fish'"
}
@test "fish instructions" {