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_foodcritic_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_foodcritic_command_callback.vader')
-rw-r--r-- | test/command_callback/test_foodcritic_command_callback.vader | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/test/command_callback/test_foodcritic_command_callback.vader b/test/command_callback/test_foodcritic_command_callback.vader index e3ad8a70..c5564cb1 100644 --- a/test/command_callback/test_foodcritic_command_callback.vader +++ b/test/command_callback/test_foodcritic_command_callback.vader @@ -1,44 +1,18 @@ Before: - Save g:ale_chef_foodcritic_executable - Save g:ale_chef_foodcritic_options - - unlet! g:ale_chef_foodcritic_executable - unlet! g:ale_chef_foodcritic_options - - call ale#test#SetDirectory('/testplugin/test') - - runtime ale_linters/chef/foodcritic.vim + call ale#assert#SetUpLinterTest('chef', 'foodcritic') After: - Restore - - unlet! b:ale_chef_foodcritic_executable - unlet! b:ale_chef_foodcritic_options - - call ale#test#RestoreDirectory() - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() Execute(The default command should be correct): - AssertEqual - \ 'foodcritic', - \ ale_linters#chef#foodcritic#GetExecutable(bufnr('')) - AssertEqual - \ ale#Escape('foodcritic') . ' %s', - \ ale_linters#chef#foodcritic#GetCommand(bufnr('')) + AssertLinter 'foodcritic', ale#Escape('foodcritic') . ' %s' Execute(Extra options should be included with escapeed tildes (~)): let b:ale_chef_foodcritic_options = '-t ~F011' - AssertEqual - \ ale#Escape('foodcritic') . ' -t \~F011 %s', - \ ale_linters#chef#foodcritic#GetCommand(bufnr('')) + AssertLinter 'foodcritic', ale#Escape('foodcritic') . ' -t \~F011 %s' Execute(The executable should be configurable): let b:ale_chef_foodcritic_executable = 'foobar' - AssertEqual - \ 'foobar', - \ ale_linters#chef#foodcritic#GetExecutable(bufnr('')) - AssertEqual - \ ale#Escape('foobar') . ' %s', - \ ale_linters#chef#foodcritic#GetCommand(bufnr('')) + AssertLinter 'foobar', ale#Escape('foobar') . ' %s' |