2018-06-06 23:58:32 -04:00
|
|
|
Before:
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#SetUpLinterTest('elixir', 'mix')
|
2018-06-07 12:47:57 -04:00
|
|
|
|
2018-06-06 23:58:32 -04:00
|
|
|
let g:env_prefix = has('win32')
|
2018-07-15 13:24:53 -04:00
|
|
|
\ ? 'set MIX_BUILD_PATH=' . ale#Escape('TEMP_DIR') . ' && '
|
|
|
|
\ : 'MIX_BUILD_PATH=' . ale#Escape('TEMP_DIR') . ' '
|
2018-06-06 23:58:32 -04:00
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! g:env_prefix
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2018-06-06 23:58:32 -04:00
|
|
|
|
|
|
|
Execute(The default mix command should be correct):
|
2018-06-07 12:47:57 -04:00
|
|
|
call ale#test#SetFilename('mix_paths/wrapped_project/lib/app.ex')
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'mix',
|
|
|
|
\ ale#path#CdString(ale#path#Simplify(g:dir . '/mix_paths/wrapped_project'))
|
2018-06-06 23:58:32 -04:00
|
|
|
\ . g:env_prefix
|
|
|
|
\ . 'mix compile %s'
|
2018-10-10 12:19:47 -04:00
|
|
|
|
|
|
|
Execute(The FindMixProjectRoot should detect the project root directory via mix.exs):
|
|
|
|
silent execute 'file ' . fnameescape(g:dir . '/elixir_paths/mix_project/lib/app.ex')
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#path#Simplify(g:dir . '/elixir_paths/mix_project'),
|
|
|
|
\ ale#handlers#elixir#FindMixProjectRoot(bufnr(''))
|