mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Force gem installation into GEM_HOME
When `--user-install` is set in the gemrc config file, `gem` ignores `GEM_HOME`. `--no-user-install` prevents this behaviour.
This commit is contained in:
parent
cc9d950601
commit
a54391e96f
2 changed files with 8 additions and 0 deletions
|
|
@ -138,6 +138,7 @@ def install_environment(
|
||||||
(
|
(
|
||||||
'gem', 'install',
|
'gem', 'install',
|
||||||
'--no-document', '--no-format-executable',
|
'--no-document', '--no-format-executable',
|
||||||
|
'--no-user-install',
|
||||||
*prefix.star('.gem'), *additional_dependencies,
|
*prefix.star('.gem'), *additional_dependencies,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,13 @@ def test_run_a_ruby_hook(tempdir_factory, store):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_run_a_ruby_hook_with_user_install_set(tempdir_factory, store, tmpdir):
|
||||||
|
gemrc = tmpdir.join('gemrc')
|
||||||
|
gemrc.write('gem: --user-install\n')
|
||||||
|
with envcontext((('GEMRC', str(gemrc)),)):
|
||||||
|
test_run_a_ruby_hook(tempdir_factory, store)
|
||||||
|
|
||||||
|
|
||||||
@xfailif_windows # pragma: win32 no cover
|
@xfailif_windows # pragma: win32 no cover
|
||||||
def test_run_versioned_ruby_hook(tempdir_factory, store):
|
def test_run_versioned_ruby_hook(tempdir_factory, store):
|
||||||
_test_hook_repo(
|
_test_hook_repo(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue