pyenv/test
Jason Karns c3a5f91ed0 create hook: version-origin
Expose a `version-origin` hook.

It is invoked *before* the traditional `rbenv-version-file` lookup. Because `version-origin` is traditionally run immediately after `version-name`, then any plugin hooks that alter `version-name` would have done so. Thus, running `version-origin` prior to printing the origin gives those plugins a chance to alter the `version-origin` to match.

If any of the hooks set `$RBENV_VERSION_ORIGIN`, then it is used as the return value. Otherwise, the existing logic continues to return "environment variable" or "filename" as appropriate.

This change, in conjunction with the `version-name` hook, makes a clean seam by which plugins can inject their own ruby version setting logic. Using this seam, as opposed to altering `$RBENV_COMMAND_PATH` from the `which` hook, means that the version name and origin are set more reliably and so `version`, `version-name`, `version-origin` and `which` all work as expected. Indeed, even PS1 works now.
2015-12-23 17:22:31 +01:00
..
libexec Add tests for rbenv PATH and RBENV_HOOK_PATH handling 2014-10-19 14:35:36 +02:00
--version.bats work around bug in git 1.8.2.1 in tests 2013-06-07 19:13:54 +02:00
commands.bats fix iterating through paths that have spaces in them 2013-04-01 01:04:19 +02:00
completions.bats Fix detecting completions support on OpenBSD 2014-01-02 22:33:54 +01:00
exec.bats Revert "rbenv exec: avoid mutating PATH" 2013-11-03 12:18:28 +02:00
global.bats tests galore 2013-03-07 15:07:32 -05:00
help.bats add tests for help and rbenv --version 2013-04-08 23:16:35 +02:00
hooks.bats undo assert_output_lines in tests 2013-04-08 23:16:35 +02:00
init.bats Fix test for adding shims in fish 2015-04-19 23:53:19 +02:00
local.bats add tests for version commands 2013-04-08 23:16:35 +02:00
prefix.bats Fix emulating the scenario where system Ruby is missing on OpenBSD 2014-01-02 22:30:21 +01:00
rbenv.bats Add rbenv's own rbenv.d directory to hook paths 2014-10-19 14:35:36 +02:00
rehash.bats Simplify the shims registration implementation in rbenv-rehash 2014-10-15 05:46:18 +02:00
run Create configure script to generate a cross-platform Makefile 2014-10-13 04:12:35 +02:00
shell.bats reliably detect parent shell in rbenv init 2013-10-07 03:24:45 +02:00
shims.bats tests galore 2013-03-07 15:07:32 -05:00
test_helper.bash Fail hard if RBENV_NATIVE_EXT is set but extensions failed to load 2014-10-13 04:12:35 +02:00
version-file-read.bats Move carriage return test to version-file-read 2014-03-21 01:32:29 +01:00
version-file-write.bats add tests for version commands 2013-04-08 23:16:35 +02:00
version-file.bats add tests for version commands 2013-04-08 23:16:35 +02:00
version-name.bats create hook: version-name 2015-12-23 17:22:30 +01:00
version-origin.bats create hook: version-origin 2015-12-23 17:22:31 +01:00
version.bats Move carriage return test to version-file-read 2014-03-21 01:32:29 +01:00
versions.bats Add tests for non-directory types under RBENV_ROOT/versions/ 2014-10-13 04:02:46 +02:00
whence.bats undo assert_output_lines in tests 2013-04-08 23:16:35 +02:00
which.bats Isolate rbenv-which tests from any .ruby-version file on the system 2014-10-13 12:39:47 +02:00