2017-07-10 22:03:36 +00:00
|
|
|
Before:
|
2017-10-23 00:26:31 +00:00
|
|
|
Save $PATH
|
|
|
|
Save $PATHEXT
|
|
|
|
|
|
|
|
" Count the gradle executable without .exe as executable on Windows
|
|
|
|
let $PATHEXT = '.'
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
runtime ale_linters/kotlin/kotlinc.vim
|
|
|
|
|
|
|
|
After:
|
2017-10-23 00:26:31 +00:00
|
|
|
Restore
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
2017-10-23 00:26:31 +00:00
|
|
|
|
2017-07-10 22:03:36 +00: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-10-23 00:26:31 +00:00
|
|
|
\ ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew'),
|
2017-07-10 22:03:36 +00: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-10-23 00:26:31 +00:00
|
|
|
let $PATH .= (has('win32') ? ';': ':') . ale#path#Winify(g:dir . '/gradle-test-files')
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
AssertEqual
|
2017-10-23 00:26:31 +00:00
|
|
|
\ 'gradle',
|
2017-07-10 22:03:36 +00: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-23 00:26:31 +00:00
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
AssertEqual
|
2017-10-23 00:26:31 +00:00
|
|
|
\ '',
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindExecutable(bufnr(''))
|