summaryrefslogtreecommitdiff
path: root/test/test_gradle_build_classpath_command.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_gradle_build_classpath_command.vader')
-rw-r--r--test/test_gradle_build_classpath_command.vader39
1 files changed, 23 insertions, 16 deletions
diff --git a/test/test_gradle_build_classpath_command.vader b/test/test_gradle_build_classpath_command.vader
index 84135268..c31dc698 100644
--- a/test/test_gradle_build_classpath_command.vader
+++ b/test/test_gradle_build_classpath_command.vader
@@ -1,37 +1,44 @@
Before:
+ Save $PATH
+ Save $PATHEXT
+
+ let $PATHEXT = '.'
+
call ale#test#SetDirectory('/testplugin/test')
runtime ale_linters/kotlin/kotlinc.vim
- let g:ale_gradle_path = $PATH
+
+ let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath())
+ \ . ' -q printClasspath'
+
+ let g:gradle_init_path = ale#path#Winify(g:dir . '../../autoload/ale/gradle/init.gradle')
After:
+ Restore
+
+ unlet! g:gradle_init_path
+ unlet! g:command_tail
+
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,
+ \ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project'))
+ \ . ' && ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/wrapped-project/gradlew'))
+ \ . g:command_tail,
\ 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'
+ let $PATH .= (has('win32') ? ';' : ':')
+ \ . ale#path#Winify(g:dir . '/gradle-test-files')
AssertEqual
- \ "cd '" . g:project_root . "' && " . g:gradle_executable . " " . g:gradle_options,
+ \ 'cd ' . ale#Escape(ale#path#Winify(g:dir . '/gradle-test-files/unwrapped-project'))
+ \ . ' && ' . ale#Escape('gradle')
+ \ . g:command_tail,
\ ale#gradle#BuildClasspathCommand(bufnr(''))
Execute(Should return empty string if gradle cannot be executed):