Support language_version for ruby as well.

This commit is contained in:
Anthony Sottile 2014-06-03 13:28:20 -07:00
parent 511de4fe32
commit 02a79bf1c3
8 changed files with 72 additions and 15 deletions

View file

@ -92,6 +92,11 @@ def ruby_hooks_repo(dummy_git_repo):
yield _make_repo(dummy_git_repo, 'ruby_hooks_repo')
@pytest.yield_fixture
def ruby_1_9_3_p547_hooks_repo(dummy_git_repo):
yield _make_repo(dummy_git_repo, 'ruby_1_9_3_p547_hooks_repo')
@pytest.yield_fixture
def consumer_repo(dummy_git_repo):
yield _make_repo(dummy_git_repo, 'consumer_repo')
@ -143,6 +148,11 @@ def config_for_ruby_hooks_repo(ruby_hooks_repo):
yield _make_config(ruby_hooks_repo, 'ruby_hook', '\\.rb$')
@pytest.yield_fixture
def config_for_ruby_1_9_3_p547_hooks_repo(ruby_1_9_3_p547_hooks_repo):
yield _make_config(ruby_1_9_3_p547_hooks_repo, 'ruby_hook', '\\.rb$')
@pytest.yield_fixture
def config_for_python_hooks_repo(python_hooks_repo):
yield _make_config(python_hooks_repo, 'foo', '\\.py$')

View file

@ -15,7 +15,21 @@ def test_install_rbenv(cmd_runner):
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
# Should be able to activate using our script and access rbenv
cmd_runner.run(
[
'bash',
'-c',
'. {prefix}/rbenv/bin/activate && rbenv --help',
],
)
@skipif_slowtests_false
def test_install_rbenv_with_version(cmd_runner):
_install_rbenv(cmd_runner, version='1.9.3p547')
# Should be able to activate and use rbenv install
cmd_runner.run(
[
'bash',

View file

@ -40,6 +40,16 @@ def test_run_versioned_node_hook(config_for_node_0_11_8_hooks_repo, store):
assert ret[1] == 'v0.11.8\nHello World\n'
@pytest.mark.herpderp
@skipif_slowtests_false
@pytest.mark.integration
def test_run_versioned_ruby_hook(config_for_ruby_1_9_3_p547_hooks_repo, store):
repo = Repository.create(config_for_ruby_1_9_3_p547_hooks_repo, store)
ret = repo.run_hook('ruby_hook', [])
assert ret[0] == 0
assert ret[1] == '1.9.3\n547\nHello world from a ruby hook\n'
@pytest.mark.integration
def test_lots_of_files(config_for_python_hooks_repo, store):
repo = Repository.create(config_for_python_hooks_repo, store)