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_swaglint_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_swaglint_command_callback.vader')
-rw-r--r-- | test/command_callback/test_swaglint_command_callback.vader | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/test/command_callback/test_swaglint_command_callback.vader b/test/command_callback/test_swaglint_command_callback.vader index 51a10094..fe8fb722 100644 --- a/test/command_callback/test_swaglint_command_callback.vader +++ b/test/command_callback/test_swaglint_command_callback.vader @@ -1,43 +1,29 @@ Before: - runtime ale_linters/yaml/swaglint.vim - - call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#assert#SetUpLinterTest('yaml', 'swaglint') After: - let g:ale_yaml_swaglint_executable = 'swaglint' - let g:ale_yaml_swaglint_use_global = 0 - - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() Execute(The yaml swaglint command callback should return the correct default string): - AssertEqual 'swaglint', - \ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) - AssertEqual 'swaglint -r compact --stdin', - \ ale_linters#yaml#swaglint#GetCommand(bufnr('')) + AssertLinter 'swaglint', 'swaglint -r compact --stdin' Execute(The yaml swaglint command callback should be configurable): let g:ale_yaml_swaglint_executable = '~/.local/bin/swaglint' - AssertEqual '~/.local/bin/swaglint', - \ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) - AssertEqual '~/.local/bin/swaglint -r compact --stdin', - \ ale_linters#yaml#swaglint#GetCommand(bufnr('')) + + AssertLinter '~/.local/bin/swaglint', + \ '~/.local/bin/swaglint -r compact --stdin' Execute(The yaml swaglint command callback should allow a global installation to be used): let g:ale_yaml_swaglint_executable = '/usr/local/bin/swaglint' let g:ale_yaml_swaglint_use_global = 1 - AssertEqual '/usr/local/bin/swaglint', - \ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) - AssertEqual '/usr/local/bin/swaglint -r compact --stdin', - \ ale_linters#yaml#swaglint#GetCommand(bufnr('')) + + AssertLinter '/usr/local/bin/swaglint', + \ '/usr/local/bin/swaglint -r compact --stdin' Execute(The yaml swaglint command callback should allow a local installation to be used): call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml') - AssertEqual + AssertLinter \ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'), - \ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) - - AssertEqual \ ale#path#Simplify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint') - \ . ' -r compact --stdin', - \ ale_linters#yaml#swaglint#GetCommand(bufnr('')) + \ . ' -r compact --stdin' |