diff options
author | Michael Pardo <kensuke155@gmail.com> | 2017-07-10 18:03:36 -0400 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-07-10 23:03:36 +0100 |
commit | d787050fa8a82eec26962055829af1f33bd70bbf (patch) | |
tree | 3170738787b73d0092f747648a2ea31851d2b2a9 /test/test_gradle_build_classpath_command.vader | |
parent | 29d0a20dc3657d046b98cbbfe08014a38f5fc378 (diff) | |
download | ale-d787050fa8a82eec26962055829af1f33bd70bbf.zip |
Kotlin and general Gradle support. (#745)
Diffstat (limited to 'test/test_gradle_build_classpath_command.vader')
-rw-r--r-- | test/test_gradle_build_classpath_command.vader | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/test_gradle_build_classpath_command.vader b/test/test_gradle_build_classpath_command.vader new file mode 100644 index 00000000..84135268 --- /dev/null +++ b/test/test_gradle_build_classpath_command.vader @@ -0,0 +1,42 @@ +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' command if project includes gradle wapper): + call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt') + + let g:project_root = '/testplugin/test/gradle-test-files/wrapped-project' + let g:gradle_executable = '/testplugin/test/gradle-test-files/wrapped-project/gradlew' + let g:gradle_init_path = '/testplugin/autoload/ale/gradle/init.gradle' + let g:gradle_options = '-I ' . g:gradle_init_path . ' -q printClasspath' + + + AssertEqual + \ "cd '" . g:project_root . "' && " . g:gradle_executable . " " . g:gradle_options, + \ ale#gradle#BuildClasspathCommand(bufnr('')) + +Execute(Should return 'gradle' command if project does not include gradle wapper): + call ale#test#SetFilename('gradle-test-files/unwrapped-project/src/main/kotlin/dummy.kt') + let $PATH .= ':' . g:dir . '/gradle-test-files' + + let g:project_root = '/testplugin/test/gradle-test-files/unwrapped-project' + let g:gradle_executable = 'gradle' + let g:gradle_init_path = '/testplugin/autoload/ale/gradle/init.gradle' + let g:gradle_options = '-I ' . g:gradle_init_path . ' -q printClasspath' + + AssertEqual + \ "cd '" . g:project_root . "' && " . g:gradle_executable . " " . g:gradle_options, + \ ale#gradle#BuildClasspathCommand(bufnr('')) + +Execute(Should return empty string if gradle cannot be executed): + call ale#test#SetFilename('gradle-test-files/non-gradle-project/src/main/kotlin/dummy.kt') + + AssertEqual + \ '', + \ ale#gradle#BuildClasspathCommand(bufnr('')) |