Commit graph

10 commits

Author SHA1 Message Date
Jason Karns
0f7a2cad8d Use create_hook helper
Use extracted create_hook helper in tests for:

- exec
- hooks
- rehash
- version-name
- version-origin
- which
2016-01-04 09:14:25 -05:00
Mislav Marohnić
90373d78b9 Add test for not including current directory in PATH search
Confirms #836
2015-12-14 11:59:01 +01:00
Mislav Marohnić
3405c4d03c Fix error message when command is not found for "system" version
If `foo` didn't exist and `RBENV_VERSION=system rbenv which foo` was
called, the error message used to be misleading:

    rbenv: version `system' is not installed

Instead, have the error message simply say that the command was not found.

Fixes #770
2015-11-13 23:10:09 -05:00
Daniel Hahler
e3982fae38 Display version origin with non-installed versions
This is useful as an indicator where it is coming from.
2015-07-17 17:10:33 +02:00
Mislav Marohnić
c69d9a1128 Isolate rbenv-which tests from any .ruby-version file on the system
Having a `.ruby-version` file in any of the parent directories of the
local clone of rbenv could cause the test suite to fail because it
wasn't expecting a local version to be set.

Fixes #533
2014-10-13 12:39:47 +02:00
Daniel Hahler
e4cbf04592 Improve performance of rbenv-which when RBENV_VERSION=system
This implements removing of the shims path element via bash
substitution, instead of jumping around in all the `$PATH` elements.
2014-10-13 12:26:43 +02:00
Mislav Marohnić
6bb7f07d2d Avoid rbenv-exec calling out to rbenv-version-name twice
Running any shim (and thus `rbenv-exec`) would always execute
`rbenv-version-name` twice: once in `rbenv-exec` and another time in
`rbenv-which`, even though RBENV_VERSION variable would have already
been populated at this point.

Now RBENV_VERSION is respected within `rbenv-which`.
2014-10-13 12:26:43 +02:00
Mislav Marohnić
060f141b21 test that IFS in hooks is correct
closes #379
2013-04-16 14:01:43 +02:00
Mislav Marohnić
7fc5f46bbb undo assert_output_lines in tests
It was a dumb idea and it wasn't even implemented perfectly.
2013-04-08 23:16:35 +02:00
Mislav Marohnić
969af1567a add tests for rehash, whence, which 2013-04-08 23:02:30 +02:00