Add check_rubocop

Uses rubocop to check syntax / style of ruby files.
This commit is contained in:
Jordan Tardif 2015-09-09 08:52:11 +00:00
parent 616c1ebd18
commit a2d690a0ab
7 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,13 @@
import pytest
from pre_commit_hooks.check_rubocop import check_rubocop
from testing.util import get_resource_path
@pytest.mark.parametrize(('filename', 'expected_retval'), (
('invalid_ruby.rb', 1),
('valid_ruby.rb', 0),
))
def test_check_rubocop(filename, expected_retval):
ret = check_rubocop([get_resource_path(filename)])
assert ret == expected_retval