summaryrefslogtreecommitdiff
path: root/test/test_gradle_find_executable.vader
diff options
context:
space:
mode:
authorMichael Pardo <kensuke155@gmail.com>2017-07-10 18:03:36 -0400
committerw0rp <w0rp@users.noreply.github.com>2017-07-10 23:03:36 +0100
commitd787050fa8a82eec26962055829af1f33bd70bbf (patch)
tree3170738787b73d0092f747648a2ea31851d2b2a9 /test/test_gradle_find_executable.vader
parent29d0a20dc3657d046b98cbbfe08014a38f5fc378 (diff)
downloadale-d787050fa8a82eec26962055829af1f33bd70bbf.zip
Kotlin and general Gradle support. (#745)
Diffstat (limited to 'test/test_gradle_find_executable.vader')
-rw-r--r--test/test_gradle_find_executable.vader31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_gradle_find_executable.vader b/test/test_gradle_find_executable.vader
new file mode 100644
index 00000000..2ae2b464
--- /dev/null
+++ b/test/test_gradle_find_executable.vader
@@ -0,0 +1,31 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test')
+ runtime ale_linters/kotlin/kotlinc.vim
+ let g:ale_gradle_path = $PATH
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+ let $PATH = g:ale_gradle_path
+
+Execute(Should return '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/gradlew',
+ \ 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')
+ let $PATH .= ':' . g:dir . '/gradle-test-files'
+
+ AssertEqual
+ \ 'gradle',
+ \ 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')
+
+ AssertEqual
+ \ '',
+ \ ale#gradle#FindExecutable(bufnr(''))