2017-10-22 13:22:16 +00:00
|
|
|
Before:
|
|
|
|
Save g:ale_elixir_mix_executable
|
2018-03-08 14:37:56 +00:00
|
|
|
Save g:ale_elixir_mix_format_options
|
2017-10-22 13:22:16 +00:00
|
|
|
|
|
|
|
let g:ale_elixir_mix_executable = 'xxxinvalid'
|
2018-03-18 17:40:34 +00:00
|
|
|
let g:ale_elixir_mix_format_options = ''
|
|
|
|
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
2017-10-22 13:22:16 +00:00
|
|
|
|
|
|
|
After:
|
2018-03-18 17:40:34 +00:00
|
|
|
Restore
|
|
|
|
|
2017-10-22 13:22:16 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
|
|
|
Execute(The mix_format callback should return the correct default values):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/elixir/testfile.ex')
|
2017-10-22 13:22:16 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape('xxxinvalid')
|
2018-03-18 17:40:34 +00:00
|
|
|
\ . ' format %t',
|
2017-10-22 13:22:16 +00:00
|
|
|
\ },
|
|
|
|
\ ale#fixers#mix_format#Fix(bufnr(''))
|
|
|
|
|
2018-03-08 14:37:56 +00:00
|
|
|
Execute(The mix_format callback should include the correct format options):
|
|
|
|
let g:ale_elixir_mix_format_options = 'invalid_options'
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/elixir/testfile.ex')
|
2018-03-08 14:37:56 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape('xxxinvalid')
|
|
|
|
\ . ' format invalid_options %t',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#mix_format#Fix(bufnr(''))
|