summaryrefslogtreecommitdiff
path: root/test/command_callback/test_dartanalyzer_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_dartanalyzer_command_callback.vader
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_dartanalyzer_command_callback.vader')
-rw-r--r--test/command_callback/test_dartanalyzer_command_callback.vader34
1 files changed, 7 insertions, 27 deletions
diff --git a/test/command_callback/test_dartanalyzer_command_callback.vader b/test/command_callback/test_dartanalyzer_command_callback.vader
index c7b51396..62b1d636 100644
--- a/test/command_callback/test_dartanalyzer_command_callback.vader
+++ b/test/command_callback/test_dartanalyzer_command_callback.vader
@@ -1,40 +1,20 @@
Before:
- Save g:ale_dart_dartanalyzer_executable
- unlet! g:ale_dart_dartanalyzer_executable
-
- runtime ale_linters/dart/dartanalyzer.vim
-
- call ale#test#SetDirectory('/testplugin/test/command_callback')
+ call ale#assert#SetUpLinterTest('dart', 'dartanalyzer')
After:
- Restore
-
- call ale#test#RestoreDirectory()
- call ale#linter#Reset()
+ call ale#assert#TearDownLinterTest()
Execute(The default command and executable should be correct):
- AssertEqual
- \ 'dartanalyzer',
- \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
- AssertEqual
- \ ale#Escape('dartanalyzer') . ' %s',
- \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
+ AssertLinter 'dartanalyzer', ale#Escape('dartanalyzer') . ' %s'
Execute(The executable should be configurable):
- let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer'
+ let g:ale_dart_dartanalyzer_executable = 'foobar'
- AssertEqual
- \ '/usr/lib/dart/bin/dartanalyzer',
- \ ale_linters#dart#dartanalyzer#GetExecutable(bufnr(''))
- AssertEqual
- \ ale#Escape('/usr/lib/dart/bin/dartanalyzer') . ' %s',
- \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
+ AssertLinter 'foobar', ale#Escape('foobar') . ' %s'
Execute(The .packages file should be set if detected):
call ale#test#SetFilename('dart_paths/foo')
- AssertEqual
- \ ale#Escape('dartanalyzer')
+ AssertLinter 'dartanalyzer', ale#Escape('dartanalyzer')
\ . ' --packages ' . ale#Escape(ale#path#Simplify(g:dir . '/dart_paths/.packages'))
- \ . ' %s',
- \ ale_linters#dart#dartanalyzer#GetCommand(bufnr(''))
+ \ . ' %s'