mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #472 from chriskuehl/gemfile-in-root
Fix ruby hooks in projects with weird options in.bundle/config
This commit is contained in:
commit
209339582c
2 changed files with 25 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ def get_env_patch(venv, language_version): # pragma: windows no cover
|
|||
patches = (
|
||||
('GEM_HOME', os.path.join(venv, 'gems')),
|
||||
('RBENV_ROOT', venv),
|
||||
('BUNDLE_IGNORE_CONFIG', '1'),
|
||||
('PATH', (
|
||||
os.path.join(venv, 'gems', 'bin'), os.pathsep,
|
||||
os.path.join(venv, 'shims'), os.pathsep,
|
||||
|
|
|
|||
|
|
@ -207,6 +207,30 @@ def test_run_versioned_ruby_hook(tempdir_factory, store):
|
|||
)
|
||||
|
||||
|
||||
@skipif_slowtests_false
|
||||
@xfailif_windows_no_ruby
|
||||
@pytest.mark.integration
|
||||
def test_run_ruby_hook_with_disable_shared_gems(
|
||||
tempdir_factory,
|
||||
store,
|
||||
tmpdir,
|
||||
):
|
||||
"""Make sure a Gemfile in the project doesn't interfere."""
|
||||
tmpdir.join('Gemfile').write('gem "lol_hai"')
|
||||
tmpdir.join('.bundle').mkdir()
|
||||
tmpdir.join('.bundle', 'config').write(
|
||||
'BUNDLE_DISABLE_SHARED_GEMS: true\n'
|
||||
'BUNDLE_PATH: vendor/gem\n'
|
||||
)
|
||||
with cwd(tmpdir.strpath):
|
||||
_test_hook_repo(
|
||||
tempdir_factory, store, 'ruby_versioned_hooks_repo',
|
||||
'ruby_hook',
|
||||
['/dev/null'],
|
||||
b'2.1.5\nHello world from a ruby hook\n',
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
def test_system_hook_with_spaces(tempdir_factory, store):
|
||||
_test_hook_repo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue