2017-07-10 22:03:36 +00:00
|
|
|
Before:
|
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
runtime ale_linters/kotlin/kotlinc.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(Should return directory for 'gradlew' if found in parent directory):
|
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-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project'),
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindProjectRoot(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return directory for 'settings.gradle' if found in parent directory):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/settings-gradle-project/src/main/kotlin/dummy.kt')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/settings-gradle-project'),
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindProjectRoot(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return directory for 'build.gradle' if found in parent directory):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('test-files/gradle/build-gradle-project/src/main/kotlin/dummy.kt')
|
2017-07-10 22:03:36 +00:00
|
|
|
|
|
|
|
AssertEqual
|
2021-03-20 22:11:22 +00:00
|
|
|
\ ale#path#Simplify(g:dir . '/test-files/gradle/build-gradle-project'),
|
2017-07-10 22:03:36 +00:00
|
|
|
\ ale#gradle#FindProjectRoot(bufnr(''))
|
|
|
|
|
|
|
|
Execute(Should return empty string if gradle files are not found in parent directory):
|
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
|
|
|
|
\ '',
|
|
|
|
\ ale#gradle#FindProjectRoot(bufnr(''))
|