summaryrefslogtreecommitdiff
path: root/test/command_callback/test_markdown_mdl_command_callback.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_callback/test_markdown_mdl_command_callback.vader')
-rw-r--r--test/command_callback/test_markdown_mdl_command_callback.vader35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/command_callback/test_markdown_mdl_command_callback.vader b/test/command_callback/test_markdown_mdl_command_callback.vader
new file mode 100644
index 00000000..2fb9a206
--- /dev/null
+++ b/test/command_callback/test_markdown_mdl_command_callback.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_markdown_mdl_executable
+ Save g:ale_markdown_mdl_options
+
+ unlet! g:ale_markdown_mdl_executable
+ unlet! g:ale_markdown_mdl_options
+
+ runtime ale_linters/markdown/mdl.vim
+
+After:
+ Restore
+
+ call ale#linter#Reset()
+
+Execute(The default command should be correct):
+ AssertEqual ale_linters#markdown#mdl#GetExecutable(bufnr('')), 'mdl'
+ AssertEqual
+ \ ale_linters#markdown#mdl#GetCommand(bufnr('')),
+ \ ale#Escape('mdl')
+
+Execute(The executable and options should be configurable):
+ let g:ale_markdown_mdl_executable = 'foo bar'
+ let g:ale_markdown_mdl_options = '--wat'
+
+ AssertEqual ale_linters#markdown#mdl#GetExecutable(bufnr('')), 'foo bar'
+ AssertEqual
+ \ ale_linters#markdown#mdl#GetCommand(bufnr('')),
+ \ ale#Escape('foo bar') . ' --wat'
+
+Execute(Setting bundle appends 'exec mdl'):
+ let g:ale_markdown_mdl_executable = 'path to/bundle'
+
+ AssertEqual
+ \ ale#Escape('path to/bundle') . ' exec mdl',
+ \ ale_linters#markdown#mdl#GetCommand(bufnr(''))