def test_integration(tmpdir): env = tmpdir.join('rubyvenv') assert not rubyvenv.main((env.strpath, )) assert _run(env, 'echo $RUBYVENV') == env + '\n' assert _run(env, 'which ruby') == env.join('bin/ruby') + '\n' assert _run(env, 'which gem') == env.join('bin/gem') + '\n' _run(env, 'gem install sass --no-document') assert _run(env, 'which sass') == env.join('bin/sass') + '\n'
def test_list_versions(capsys): ret = rubyvenv.main(('--list', )) assert ret is None out, _ = capsys.readouterr() assert out == ('Available versions for ubuntu 16.04 (x86_64):\n' '\n' 'Prebuilt:\n' ' - 2.0.0-p648\n' ' - 2.1.5\n' ' - 2.1.9\n' ' - 2.2.5\n' ' - 2.3.0\n' ' - 2.3.1\n')
def test_integration_system(tmpdir): env = tmpdir.join('rubyvenv') assert not rubyvenv.main((env.strpath, '--ruby', 'system')) _run(env, 'gem install sass --no-document') assert _run(env, 'which sass') == env.join('lib/gems/bin/sass') + '\n'
def test_missing_dest_dir(capsys): with pytest.raises(SystemExit): rubyvenv.main(()) out, err = capsys.readouterr() assert 'DEST_DIR is required' in out + err