9fe7b1fe6a
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
27 lines
780 B
Text
27 lines
780 B
Text
Before:
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
runtime ale_linters/java/javac.vim
|
|
|
|
Save $PATH
|
|
let $PATH = ale#path#Simplify(g:dir . '/ant-test-files/bin')
|
|
|
|
After:
|
|
Restore
|
|
|
|
call ale#test#RestoreDirectory()
|
|
call ale#linter#Reset()
|
|
|
|
Execute(Should return `cd '[dir]' && 'ant' classpath -S -q`):
|
|
call ale#test#SetFilename('ant-test-files/ant-project/Main.java')
|
|
|
|
AssertEqual
|
|
\ [
|
|
\ ale#path#Simplify(g:dir . '/ant-test-files/ant-project'),
|
|
\ ale#Escape('ant') . ' classpath' . ' -S' . ' -q',
|
|
\ ],
|
|
\ ale#ant#BuildClasspathCommand(bufnr(''))
|
|
|
|
Execute(Should return empty string if ant cannot be executed):
|
|
call ale#test#SetFilename('ant-test-files/not-an-ant-project/Main.java')
|
|
|
|
AssertEqual ['', ''], ale#ant#BuildClasspathCommand(bufnr(''))
|