diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_vint_command_callback.vader | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_vint_command_callback.vader')
-rw-r--r-- | test/command_callback/test_vint_command_callback.vader | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/test/command_callback/test_vint_command_callback.vader b/test/command_callback/test_vint_command_callback.vader index ddf39f31..e0051f26 100644 --- a/test/command_callback/test_vint_command_callback.vader +++ b/test/command_callback/test_vint_command_callback.vader @@ -1,39 +1,23 @@ Before: - Save g:ale_vim_vint_executable - - unlet! g:ale_vim_vint_executable - - runtime ale_linters/vim/vint.vim - + call ale#assert#SetUpLinterTest('vim', 'vint') let b:command_tail = (has('nvim') ? ' --enable-neovim' : '') \ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})" %t' - call ale#semver#ResetVersionCache() After: - Restore - - call ale#linter#Reset() - call ale#semver#ResetVersionCache() - unlet! b:bin_dir unlet! b:executable + call ale#assert#TearDownLinterTest() Execute(The default command should be correct): - AssertEqual 'vint', ale_linters#vim#vint#GetExecutable(bufnr('')) - AssertEqual + AssertLinter 'vint', [ \ ale#Escape('vint') .' --version', - \ ale_linters#vim#vint#VersionCommand(bufnr('')) - AssertEqual \ ale#Escape('vint') .' -s --no-color' . b:command_tail, - \ ale_linters#vim#vint#GetCommand(bufnr(''), []) + \] Execute(The executable should be configurable): let g:ale_vim_vint_executable = 'foobar' - AssertEqual 'foobar', ale_linters#vim#vint#GetExecutable(bufnr('')) - AssertEqual + AssertLinter 'foobar', [ \ ale#Escape('foobar') .' --version', - \ ale_linters#vim#vint#VersionCommand(bufnr('')) - AssertEqual \ ale#Escape('foobar') .' -s --no-color' . b:command_tail, - \ ale_linters#vim#vint#GetCommand(bufnr(''), []) + \] |