diff options
author | Colby Dehart <colbydehart@gmail.com> | 2018-06-06 22:58:32 -0500 |
---|---|---|
committer | Colby Dehart <colbydehart@gmail.com> | 2018-06-07 10:09:08 -0500 |
commit | f0f569f14a18459dcd99a381c5776f7464dfb125 (patch) | |
tree | 82b9e50d19d298b7d69dd3fa2ecc0a374edabd69 /test/command_callback/test_elixir_mix_command_callbacks.vader | |
parent | 81739be0a04956458471f196874d4206b21e60fb (diff) | |
download | ale-f0f569f14a18459dcd99a381c5776f7464dfb125.zip |
added test for command callback
Diffstat (limited to 'test/command_callback/test_elixir_mix_command_callbacks.vader')
-rw-r--r-- | test/command_callback/test_elixir_mix_command_callbacks.vader | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/command_callback/test_elixir_mix_command_callbacks.vader b/test/command_callback/test_elixir_mix_command_callbacks.vader new file mode 100644 index 00000000..28c09e33 --- /dev/null +++ b/test/command_callback/test_elixir_mix_command_callbacks.vader @@ -0,0 +1,36 @@ +Before: + runtime ale_linters/elixir/mix.vim + + call ale#test#SetDirectory('/testplugin/test/command_callback') + + let g:env_prefix = has('win32') + \ ? 'set MIX_BUILD_PATH=TEMP && ' + \ : 'MIX_BUILD_PATH=TEMP ' + + + function! GetCommand() abort + let l:command = ale_linters#elixir#mix#GetCommand(bufnr('')) + + let l:split_command = split(l:command, 'MIX_BUILD_PATH=[^ ]*\s') + + return l:split_command[0] . 'MIX_BUILD_PATH=TEMP' . l:split_command[1] + endfunction + + + +After: + Restore + + unlet! g:env_prefix + + call ale#linter#Reset() + call ale#test#RestoreDirectory() + + delfunction GetCommand + +Execute(The default mix command should be correct): + AssertEqual + \ GetCommand(), + \ 'cd '''' && ' + \ . g:env_prefix + \ . 'mix compile %s' |