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:
Anthony Sottile 2017-01-24 06:22:43 -08:00 committed by GitHub
commit 209339582c
2 changed files with 25 additions and 0 deletions

View file

@ -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,

View file

@ -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(