2017-07-10 18:03:36 -04:00
|
|
|
Before:
|
2017-10-22 20:26:31 -04:00
|
|
|
Save $PATH
|
|
|
|
Save $PATHEXT
|
|
|
|
|
|
|
|
" Count the gradle executable without .exe as executable on Windows
|
|
|
|
let $PATHEXT = '.'
|
|
|
|
|
2017-07-10 18:03:36 -04:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
runtime ale_linters/kotlin/kotlinc.vim
|
|
|
|
|
|
|
|
After:
|
2017-10-22 20:26:31 -04:00
|
|
|
Restore
|
|
|
|
|
2017-07-10 18:03:36 -04:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
2017-10-22 20:26:31 -04:00
|
|
|
|
2017-07-10 18:03:36 -04:00
|
|
|
Execute(Should return 'gradlew' if found in parent directory):
|
|
|
|
call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')
|
|
|
|
|
|
|
|
AssertEqual
|
2017-12-19 13:23:09 -05:00
|
|
|
\ ale#path#Simplify(g:dir . '/gradle-test-files/wrapped-project/gradlew'),
|
2017-07-10 18:03:36 -04:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return 'gradle' if 'gradlew' not found in parent directory):
|
|
|
|
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
|
2017-12-19 13:23:09 -05:00
|
|
|
let $PATH .= (has('win32') ? ';': ':') . ale#path#Simplify(g:dir . '/gradle-test-files')
|
2017-10-22 20:26:31 -04:00
|
|
|
|
2017-07-10 18:03:36 -04:00
|
|
|
AssertEqual
|
2017-10-22 20:26:31 -04:00
|
|
|
\ 'gradle',
|
2017-07-10 18:03:36 -04:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return empty string if 'gradlew' not in parent directory and gradle not in path):
|
|
|
|
call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt')
|
2017-10-22 20:26:31 -04:00
|
|
|
|
2017-07-10 18:03:36 -04:00
|
|
|
AssertEqual
|
2017-10-22 20:26:31 -04:00
|
|
|
\ '',
|
2017-07-10 18:03:36 -04:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|