This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/fixers/test_mix_format_fixer_callback.vader
2018-03-08 15:29:10 +00:00

32 lines
921 B
Text

Before:
call ale#test#SetDirectory('/testplugin/test/fixers')
Save g:ale_elixir_mix_executable
Save g:ale_elixir_mix_format_options
let g:ale_elixir_mix_executable = 'xxxinvalid'
After:
call ale#test#RestoreDirectory()
Execute(The mix_format callback should return the correct default values):
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('xxxinvalid')
\ . ' format %t',
\ },
\ ale#fixers#mix_format#Fix(bufnr(''))
Execute(The mix_format callback should include the correct format options):
let g:ale_elixir_mix_format_options = 'invalid_options'
call ale#test#SetFilename('../elixir-test-files/testfile.ex')
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape('xxxinvalid')
\ . ' format invalid_options %t',
\ },
\ ale#fixers#mix_format#Fix(bufnr(''))