2018-06-23 10:10:28 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_html_tidy_executable
|
|
|
|
|
2021-03-20 22:11:22 +00:00
|
|
|
let g:ale_html_tidy_executable = '../test-files/tidy/tidy'
|
2018-06-23 10:10:28 +00:00
|
|
|
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
|
|
|
Execute(The tidy callback should return 0 if tidy not found):
|
|
|
|
let g:ale_html_tidy_executable = 'xxxinvalidpath'
|
|
|
|
AssertEqual
|
|
|
|
\ 0,
|
|
|
|
\ ale#fixers#tidy#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The tidy callback should return the correct default command):
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
2021-03-20 22:11:22 +00:00
|
|
|
\ 'command': ale#Escape('../test-files/tidy/tidy')
|
2018-06-23 10:10:28 +00:00
|
|
|
\ . ' -q --tidy-mark no --show-errors 0 --show-warnings 0'
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#tidy#Fix(bufnr(''))
|