mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Support ruby through a combination of rbenv, ruby-build, and GEM_HOME
This commit is contained in:
parent
390af24c44
commit
b381bb68b7
10 changed files with 124 additions and 24 deletions
23
tests/languages/ruby_test.py
Normal file
23
tests/languages/ruby_test.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import os.path
|
||||
|
||||
from pre_commit.languages.ruby import _install_rbenv
|
||||
|
||||
|
||||
def test_install_rbenv(cmd_runner):
|
||||
_install_rbenv(cmd_runner)
|
||||
# Should have created rbenv directory
|
||||
assert os.path.exists(cmd_runner.path('rbenv'))
|
||||
# It should be a git checkout
|
||||
assert os.path.exists(cmd_runner.path('rbenv', '.git'))
|
||||
# We should have created our `activate` script
|
||||
activate_path = cmd_runner.path('rbenv', 'bin', 'activate')
|
||||
assert os.path.exists(activate_path)
|
||||
|
||||
# Should be able to activate using our script and access the install method
|
||||
cmd_runner.run(
|
||||
[
|
||||
'bash',
|
||||
'-c',
|
||||
'. {prefix}/rbenv/bin/activate && rbenv install --help',
|
||||
],
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue