Clean up tests to stop people copy and pasting the wrong examples

This commit is contained in:
w0rp
2017-11-15 17:21:17 +00:00
parent e721f851b4
commit b14377915b
35 changed files with 133 additions and 104 deletions

View File

@@ -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(''))

View File

@@ -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(''))

View File

@@ -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(''))

View File

@@ -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(''))

View File

@@ -28,6 +28,7 @@ Before:
After:
Restore
delfunction GetCommand
unlet! b:ale_thrift_thrift_executable
unlet! b:ale_thrift_thrift_generators

View File

@@ -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)))