mirror of https://github.com/dense-analysis/ale
34 lines
856 B
Plaintext
34 lines
856 B
Plaintext
Before:
|
|
Save g:ale_crystal_format_executable
|
|
Save g:ale_crystal_format_options
|
|
|
|
" Use an invalid global executable, so we don't match it.
|
|
let g:ale_crystal_format_executable = 'xxxinvalid'
|
|
let g:ale_crystal_format_options = ''
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
|
|
After:
|
|
Restore
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
Execute(The crystal format callback should return the correct default values):
|
|
|
|
AssertEqual
|
|
\ {
|
|
\ 'command': ale#Escape('xxxinvalid') . ' tool format -',
|
|
\ },
|
|
\ ale#fixers#crystal#Fix(bufnr(''))
|
|
|
|
Execute(The crystal format callback should include custom options):
|
|
let g:ale_crystal_format_options = "-list=true"
|
|
|
|
AssertEqual
|
|
\ {
|
|
\ 'command': ale#Escape('xxxinvalid')
|
|
\ . ' tool format ' . g:ale_crystal_format_options
|
|
\ . ' -',
|
|
\ },
|
|
\ ale#fixers#crystal#Fix(bufnr(''))
|