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_markdown_mdl_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_markdown_mdl_command_callback.vader')
-rw-r--r-- | test/command_callback/test_markdown_mdl_command_callback.vader | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/test/command_callback/test_markdown_mdl_command_callback.vader b/test/command_callback/test_markdown_mdl_command_callback.vader index 2fb9a206..e029bf9b 100644 --- a/test/command_callback/test_markdown_mdl_command_callback.vader +++ b/test/command_callback/test_markdown_mdl_command_callback.vader @@ -1,35 +1,19 @@ Before: - Save g:ale_markdown_mdl_executable - Save g:ale_markdown_mdl_options - - unlet! g:ale_markdown_mdl_executable - unlet! g:ale_markdown_mdl_options - - runtime ale_linters/markdown/mdl.vim + call ale#assert#SetUpLinterTest('markdown', 'mdl') After: - Restore - - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() Execute(The default command should be correct): - AssertEqual ale_linters#markdown#mdl#GetExecutable(bufnr('')), 'mdl' - AssertEqual - \ ale_linters#markdown#mdl#GetCommand(bufnr('')), - \ ale#Escape('mdl') + AssertLinter 'mdl', ale#Escape('mdl') Execute(The executable and options should be configurable): let g:ale_markdown_mdl_executable = 'foo bar' let g:ale_markdown_mdl_options = '--wat' - AssertEqual ale_linters#markdown#mdl#GetExecutable(bufnr('')), 'foo bar' - AssertEqual - \ ale_linters#markdown#mdl#GetCommand(bufnr('')), - \ ale#Escape('foo bar') . ' --wat' + AssertLinter 'foo bar', ale#Escape('foo bar') . ' --wat' Execute(Setting bundle appends 'exec mdl'): let g:ale_markdown_mdl_executable = 'path to/bundle' - AssertEqual - \ ale#Escape('path to/bundle') . ' exec mdl', - \ ale_linters#markdown#mdl#GetCommand(bufnr('')) + AssertLinter 'path to/bundle', ale#Escape('path to/bundle') . ' exec mdl' |