diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-15 17:21:17 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-15 17:21:17 +0000 |
commit | b14377915b9948454322cd95a86bcc298c03f77a (patch) | |
tree | fb67e7281a8778bd4a50676a2be7fb11fd846d54 /test/command_callback | |
parent | e721f851b41b8f6f31067ae2a137019e1cb5546c (diff) | |
download | ale-b14377915b9948454322cd95a86bcc298c03f77a.zip |
Clean up tests to stop people copy and pasting the wrong examples
Diffstat (limited to 'test/command_callback')
6 files changed, 13 insertions, 12 deletions
diff --git a/test/command_callback/test_proto_command_callback.vader b/test/command_callback/test_proto_command_callback.vader index 2730bb84..2fd7775e 100644 --- a/test/command_callback/test_proto_command_callback.vader +++ b/test/command_callback/test_proto_command_callback.vader @@ -9,8 +9,6 @@ After: call ale#linter#Reset() Execute(The default command should be correct): - AssertEqual \ 'protoc' . ' -I ' . ale#Escape(getcwd()) . ' --lint_out=. ' . '%s', \ ale_linters#proto#protoc_gen_lint#GetCommand(bufnr('')) - diff --git a/test/command_callback/test_pycodestyle_command_callback.vader b/test/command_callback/test_pycodestyle_command_callback.vader index 58aefa20..5b309e19 100644 --- a/test/command_callback/test_pycodestyle_command_callback.vader +++ b/test/command_callback/test_pycodestyle_command_callback.vader @@ -1,13 +1,15 @@ Before: + Save g:ale_python_pycodestyle_executable + Save g:ale_python_pycodestyle_options + Save g:ale_python_pycodestyle_use_global + runtime ale_linters/python/pycodestyle.vim - Save g:ale_python_pycodestyle_executable, - \ g:ale_python_pycodestyle_options, - \ g:ale_python_pycodestyle_use_global After: - call ale#linter#Reset() Restore + call ale#linter#Reset() + Execute(The pycodestyle command callback should return default string): AssertEqual ale#Escape('pycodestyle') . ' -', \ ale_linters#python#pycodestyle#GetCommand(bufnr('')) diff --git a/test/command_callback/test_swaglint_command_callback.vader b/test/command_callback/test_swaglint_command_callback.vader index 379aa0cc..0f1d870e 100644 --- a/test/command_callback/test_swaglint_command_callback.vader +++ b/test/command_callback/test_swaglint_command_callback.vader @@ -1,12 +1,14 @@ Before: runtime ale_linters/yaml/swaglint.vim + call ale#test#SetDirectory('/testplugin/test/command_callback') After: - call ale#linter#Reset() let g:ale_yaml_swaglint_executable = 'swaglint' let g:ale_yaml_swaglint_use_global = 0 + call ale#linter#Reset() + Execute(The yaml swaglint command callback should return the correct default string): AssertEqual 'swaglint', \ ale_linters#yaml#swaglint#GetExecutable(bufnr('')) diff --git a/test/command_callback/test_terraform_tflint_command_callback.vader b/test/command_callback/test_terraform_tflint_command_callback.vader index b0b4c955..a4ae56b0 100644 --- a/test/command_callback/test_terraform_tflint_command_callback.vader +++ b/test/command_callback/test_terraform_tflint_command_callback.vader @@ -1,15 +1,13 @@ Before: - Save g:ale_terraform_tflint_executable Save g:ale_terraform_tflint_options runtime ale_linters/terraform/tflint.vim - After: Restore - call ale#linter#Reset() + call ale#linter#Reset() Execute(The default executable should be configurable): AssertEqual 'tflint', ale_linters#terraform#tflint#GetExecutable(bufnr('')) diff --git a/test/command_callback/test_thrift_command_callback.vader b/test/command_callback/test_thrift_command_callback.vader index 67008919..7d4e436c 100644 --- a/test/command_callback/test_thrift_command_callback.vader +++ b/test/command_callback/test_thrift_command_callback.vader @@ -28,6 +28,7 @@ Before: After: Restore + delfunction GetCommand unlet! b:ale_thrift_thrift_executable unlet! b:ale_thrift_thrift_generators diff --git a/test/command_callback/test_xmllint_command_callback.vader b/test/command_callback/test_xmllint_command_callback.vader index 3cffde88..12ca15de 100644 --- a/test/command_callback/test_xmllint_command_callback.vader +++ b/test/command_callback/test_xmllint_command_callback.vader @@ -2,10 +2,11 @@ Before: runtime ale_linters/xml/xmllint.vim After: - call ale#linter#Reset() let g:ale_xml_xmllint_options = '' let g:ale_xml_xmllint_executable = 'xmllint' + call ale#linter#Reset() + Execute(The xml xmllint command callback should return the correct default string): AssertEqual ale#Escape('xmllint') . ' --noout -', \ join(split(ale_linters#xml#xmllint#GetCommand(1))) @@ -22,4 +23,3 @@ Execute(The xmllint executable should be configurable): AssertEqual '~/.local/bin/xmllint', ale_linters#xml#xmllint#GetExecutable(1) AssertEqual ale#Escape('~/.local/bin/xmllint') . ' --noout -', \ join(split(ale_linters#xml#xmllint#GetCommand(1))) - |