2017-07-10 22:03:36 +00:00
|
|
|
Before:
|
2017-10-23 00:26:31 +00:00
|
|
|
Save $PATH
|
|
|
|
Save $PATHEXT
|
|
|
|
|
|
|
|
let $PATHEXT = '.'
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
runtime ale_linters/kotlin/kotlinc.vim
|
2017-10-23 00:26:31 +00:00
|
|
|
|
|
|
|
let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath())
|
|
|
|
\ . ' -q printClasspath'
|
|
|
|
|
2017-12-19 18:23:09 +00:00
|
|
|
let g:gradle_init_path = ale#path#Simplify(g:dir . '../../autoload/ale/gradle/init.gradle')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
After:
|
2017-10-23 00:26:31 +00:00
|
|
|
Restore
|
|
|
|
|
|
|
|
unlet! g:gradle_init_path
|
|
|
|
unlet! g:command_tail
|
|
|
|
|
2017-07-10 22:03:36 +00:00
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(Should return 'gradlew' command if project includes gradle wapper):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/wrapped-project/src/main/kotlin/dummy.kt')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-01 20:11:10 +00:00
|
|
|
\ [
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project'),
|
|
|
|
\ ale#Escape(ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project/gradlew'))
|
2017-10-23 00:26:31 +00:00
|
|
|
\ . g:command_tail,
|
2021-03-01 20:11:10 +00:00
|
|
|
\ ],
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#BuildClasspathCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return 'gradle' command if project does not include gradle wapper):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/unwrapped-project/src/main/kotlin/dummy.kt')
|
2017-10-23 00:26:31 +00:00
|
|
|
let $PATH .= (has('win32') ? ';' : ':')
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#path#Simplify(g:dir . '/test-files/gradle')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-01 20:11:10 +00:00
|
|
|
\ [
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/unwrapped-project'),
|
2021-03-01 20:11:10 +00:00
|
|
|
\ ale#Escape('gradle') . g:command_tail
|
|
|
|
\ ],
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#BuildClasspathCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return empty string if gradle cannot be executed):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/non-gradle-project/src/main/kotlin/dummy.kt')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-01 20:11:10 +00:00
|
|
|
\ ['', ''],
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#BuildClasspathCommand(bufnr(''))
|