fix test's and delete unused code

This commit is contained in:
Carlos Ramos 2017-10-22 09:22:16 -04:00
parent 43653ef548
commit 3212278c91
4 changed files with 21 additions and 23 deletions

View File

@ -9,8 +9,7 @@ endfunction
function! ale#fixers#mix_format#Fix(buffer) abort
return {
\ 'command': ale#handlers#elixir#GetExecutable(a:buffer)
\ . ale#fixers#mix_format#GetExecutable(a:buffer)
\ 'command': ale#Escape(ale#fixers#mix_format#GetExecutable(a:buffer))
\ . ' format %t',
\ 'read_temporary_file': 1,
\}

View File

@ -1,5 +0,0 @@
call ale#Set('elixir_executable', '')
function! ale#handlers#elixir#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'elixir_executable')
endfunction

View File

@ -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(''))

View 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(''))