add doc and test

This commit is contained in:
cyy
2019-09-23 10:43:31 +08:00
parent 983c7e8805
commit 9d1a71a5cb
8 changed files with 65 additions and 5 deletions

View File

View File

@@ -0,0 +1,40 @@
Before:
Save g:ale_fish_fishindent_executable
Save g:ale_fish_fishindent_options
" Use an invalid global executable, so we don't match it.
let g:ale_fish_fishindent_executable = 'xxxinvalid'
let g:ale_fish_fishindent_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
After:
Restore
call ale#test#RestoreDirectory()
Execute(The fish_indent callback should return the correct default values):
call ale#test#SetFilename('../fish_files/testfile.fish')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('xxxinvalid')
\ . ' -w '
\ . ' %t',
\ },
\ ale#fixers#fish_indent#Fix(bufnr(''))
Execute(The fish_indent callback should include custom fish_indent options):
let g:ale_fish_fishindent_options = "-d"
call ale#test#SetFilename('../fish_files/testfile.fish')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('xxxinvalid')
\ . ' -w '
\ . ' -d'
\ . ' %t',
\ },
\ ale#fixers#fish_indent#Fix(bufnr(''))