2017-11-05 21:24:41 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_sh_shfmt_executable
|
|
|
|
Save g:ale_sh_shfmt_options
|
|
|
|
|
2017-11-05 21:31:41 +00:00
|
|
|
After:
|
|
|
|
Restore
|
2017-11-05 21:24:41 +00:00
|
|
|
|
|
|
|
Execute(The shfmt callback should return the correct default values):
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
2017-11-05 21:31:41 +00:00
|
|
|
\ 'command': ale#Escape('shfmt'),
|
2017-11-05 21:24:41 +00:00
|
|
|
\ },
|
|
|
|
\ ale#fixers#shfmt#Fix(bufnr(''))
|
|
|
|
|
2017-11-05 21:31:41 +00:00
|
|
|
Execute(The shfmt executable and options should be configurable):
|
|
|
|
let g:ale_sh_shfmt_executable = 'foobar'
|
2017-11-05 21:24:41 +00:00
|
|
|
let g:ale_sh_shfmt_options = '--some-option'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
2017-11-05 21:31:41 +00:00
|
|
|
\ 'command': ale#Escape('foobar')
|
2017-11-05 21:24:41 +00:00
|
|
|
\ . ' --some-option',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#shfmt#Fix(bufnr(''))
|