From d787050fa8a82eec26962055829af1f33bd70bbf Mon Sep 17 00:00:00 2001 From: Michael Pardo Date: Mon, 10 Jul 2017 18:03:36 -0400 Subject: Kotlin and general Gradle support. (#745) --- test/test_gradle_find_project_root.vader | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/test_gradle_find_project_root.vader (limited to 'test/test_gradle_find_project_root.vader') diff --git a/test/test_gradle_find_project_root.vader b/test/test_gradle_find_project_root.vader new file mode 100644 index 00000000..bd1b8d7d --- /dev/null +++ b/test/test_gradle_find_project_root.vader @@ -0,0 +1,35 @@ +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): + call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt') + + AssertEqual + \ g:dir . '/gradle-test-files/wrapped-project', + \ ale#gradle#FindProjectRoot(bufnr('')) + +Execute(Should return directory for 'settings.gradle' if found in parent directory): + call ale#test#SetFilename('gradle-test-files/settings-gradle-project/src/main/kotlin/dummy.kt') + + AssertEqual + \ g:dir . '/gradle-test-files/settings-gradle-project', + \ ale#gradle#FindProjectRoot(bufnr('')) + +Execute(Should return directory for 'build.gradle' if found in parent directory): + call ale#test#SetFilename('gradle-test-files/build-gradle-project/src/main/kotlin/dummy.kt') + + AssertEqual + \ g:dir . '/gradle-test-files/build-gradle-project', + \ ale#gradle#FindProjectRoot(bufnr('')) + +Execute(Should return empty string if gradle files are not found in parent directory): + call ale#test#SetFilename('gradle-test-files/non-gradle-project/src/main/kotlin/dummy.kt') + + AssertEqual + \ '', + \ ale#gradle#FindProjectRoot(bufnr('')) -- cgit v1.2.3