fix test's and delete unused code
This commit is contained in:
parent
43653ef548
commit
3212278c91
@ -9,8 +9,7 @@ endfunction
|
|||||||
|
|
||||||
function! ale#fixers#mix_format#Fix(buffer) abort
|
function! ale#fixers#mix_format#Fix(buffer) abort
|
||||||
return {
|
return {
|
||||||
\ 'command': ale#handlers#elixir#GetExecutable(a:buffer)
|
\ 'command': ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
|
||||||
\ . ale#fixers#mix_format#GetExecutable(a:buffer)
|
|
||||||
\ . ' format %t',
|
\ . ' format %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
\}
|
\}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
call ale#Set('elixir_executable', '')
|
|
||||||
|
|
||||||
function! ale#handlers#elixir#GetExecutable(buffer) abort
|
|
||||||
return ale#Var(a:buffer, 'elixir_executable')
|
|
||||||
endfunction
|
|
@ -1,16 +0,0 @@
|
|||||||
Before:
|
|
||||||
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
||||||
|
|
||||||
After:
|
|
||||||
call ale#test#RestoreDirectory()
|
|
||||||
|
|
||||||
Execute(The executable path should be correct):
|
|
||||||
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
|
|
||||||
|
|
||||||
AssertEqual
|
|
||||||
\ {
|
|
||||||
\ 'read_temporary_file': 1,
|
|
||||||
\ 'command': 'mix format'
|
|
||||||
\ . ' %t',
|
|
||||||
\ },
|
|
||||||
\ ale#fixers#elixir#Fix(bufnr(''))
|
|
20
test/fixers/test_mix_format_fixer_callback.vader
Normal file
20
test/fixers/test_mix_format_fixer_callback.vader
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Before:
|
||||||
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
||||||
|
Save g:ale_elixir_mix_executable
|
||||||
|
|
||||||
|
let g:ale_elixir_mix_executable = 'xxxinvalid'
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#test#RestoreDirectory()
|
||||||
|
|
||||||
|
Execute(The mix_format callback should return the correct default values):
|
||||||
|
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
|
||||||
|
|
||||||
|
AssertEqual
|
||||||
|
\ {
|
||||||
|
\ 'read_temporary_file': 1,
|
||||||
|
\ 'command': ale#Escape('xxxinvalid')
|
||||||
|
\ . ' format %t',
|
||||||
|
\ },
|
||||||
|
\ ale#fixers#mix_format#Fix(bufnr(''))
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user