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_terraform_tflint_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_terraform_tflint_command_callback.vader')
-rw-r--r-- | test/command_callback/test_terraform_tflint_command_callback.vader | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/test/command_callback/test_terraform_tflint_command_callback.vader b/test/command_callback/test_terraform_tflint_command_callback.vader index a4ae56b0..c32d9bcf 100644 --- a/test/command_callback/test_terraform_tflint_command_callback.vader +++ b/test/command_callback/test_terraform_tflint_command_callback.vader @@ -1,30 +1,19 @@ Before: - Save g:ale_terraform_tflint_executable - Save g:ale_terraform_tflint_options - - runtime ale_linters/terraform/tflint.vim + call ale#assert#SetUpLinterTest('terraform', 'tflint') After: - Restore + call ale#assert#TearDownLinterTest() - call ale#linter#Reset() +Execute(The default command should be correct): + AssertLinter 'tflint', ale#Escape('tflint') . ' -f json %t' Execute(The default executable should be configurable): - AssertEqual 'tflint', ale_linters#terraform#tflint#GetExecutable(bufnr('')) - - let g:ale_terraform_tflint_executable = 'asdf' + let b:ale_terraform_tflint_executable = 'asdf' - AssertEqual 'asdf', ale_linters#terraform#tflint#GetExecutable(bufnr('')) + AssertLinter 'asdf', ale#Escape('asdf') . ' -f json %t' -Execute(The default command should be good): - let g:ale_terraform_tflint_executable = 'tflint' - AssertEqual - \ ale#Escape('tflint') . ' -f json %t', - \ ale_linters#terraform#tflint#GetCommand(bufnr('')) - -Execute(Overriding things should work): +Execute(Overriding options should work): let g:ale_terraform_tflint_executable = 'fnord' let g:ale_terraform_tflint_options = '--whatever' - AssertEqual - \ ale#Escape('fnord') . ' --whatever -f json %t', - \ ale_linters#terraform#tflint#GetCommand(bufnr('')) + + AssertLinter 'fnord', ale#Escape('fnord') . ' --whatever -f json %t' |