Massively reduce the amount of code needed for linter tests

This commit is contained in:
w0rp
2018-07-15 18:24:53 +01:00
parent 5155a35a80
commit a42999a639
138 changed files with 1447 additions and 3017 deletions

View File

@@ -1,25 +1,15 @@
Before:
runtime ale_linters/javascript/jscs.vim
call ale#assert#SetUpLinterTest('javascript', 'jscs')
After:
call ale#linter#Reset()
let g:ale_javascript_jscs_executable = 'jscs'
call ale#assert#TearDownLinterTest()
Execute(Should return the correct default values):
AssertEqual
\ 'jscs',
\ ale_linters#javascript#jscs#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('jscs') . ' --reporter inline --no-colors -',
\ ale_linters#javascript#jscs#GetCommand(bufnr(''))
AssertLinter 'jscs',
\ ale#Escape('jscs') . ' --reporter inline --no-colors -'
Execute(Should allow using a custom executable):
let g:ale_javascript_jscs_executable = 'foobar'
AssertEqual
\ 'foobar',
\ ale_linters#javascript#jscs#GetExecutable(bufnr(''))
AssertEqual
\ ale#Escape('foobar') . ' --reporter inline --no-colors -',
\ ale_linters#javascript#jscs#GetCommand(bufnr(''))
AssertLinter 'foobar',
\ ale#Escape('foobar') . ' --reporter inline --no-colors -'