summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-04-08 18:10:00 +0100
committerw0rp <devw0rp@gmail.com>2018-04-08 18:10:00 +0100
commit1123669839c1656deb20f433fc672ca0abdda705 (patch)
tree462f84ae6933029e7c977c1e0e4fea94ed8585d2 /test/command_callback
parentf9ae58849a8b465e367ed311f0506bae2a537a62 (diff)
downloadale-1123669839c1656deb20f433fc672ca0abdda705.zip
Close #1315 - Make the vint executable configurable
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_vint_command_callback.vader39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/command_callback/test_vint_command_callback.vader b/test/command_callback/test_vint_command_callback.vader
new file mode 100644
index 00000000..ddf39f31
--- /dev/null
+++ b/test/command_callback/test_vint_command_callback.vader
@@ -0,0 +1,39 @@
+Before:
+ Save g:ale_vim_vint_executable
+
+ unlet! g:ale_vim_vint_executable
+
+ runtime ale_linters/vim/vint.vim
+
+ let b:command_tail = (has('nvim') ? ' --enable-neovim' : '')
+ \ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})" %t'
+ call ale#semver#ResetVersionCache()
+
+After:
+ Restore
+
+ call ale#linter#Reset()
+ call ale#semver#ResetVersionCache()
+
+ unlet! b:bin_dir
+ unlet! b:executable
+
+Execute(The default command should be correct):
+ AssertEqual 'vint', ale_linters#vim#vint#GetExecutable(bufnr(''))
+ AssertEqual
+ \ ale#Escape('vint') .' --version',
+ \ ale_linters#vim#vint#VersionCommand(bufnr(''))
+ AssertEqual
+ \ ale#Escape('vint') .' -s --no-color' . b:command_tail,
+ \ ale_linters#vim#vint#GetCommand(bufnr(''), [])
+
+Execute(The executable should be configurable):
+ let g:ale_vim_vint_executable = 'foobar'
+
+ AssertEqual 'foobar', ale_linters#vim#vint#GetExecutable(bufnr(''))
+ AssertEqual
+ \ ale#Escape('foobar') .' --version',
+ \ ale_linters#vim#vint#VersionCommand(bufnr(''))
+ AssertEqual
+ \ ale#Escape('foobar') .' -s --no-color' . b:command_tail,
+ \ ale_linters#vim#vint#GetCommand(bufnr(''), [])