]> git.madduck.net Git - etc/vim.git/blob - test/test_gradle_build_classpath_command.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / test_gradle_build_classpath_command.vader
1 Before:
2   Save $PATH
3   Save $PATHEXT
4
5   let $PATHEXT = '.'
6
7   call ale#test#SetDirectory('/testplugin/test')
8   runtime ale_linters/kotlin/kotlinc.vim
9
10   let g:command_tail = ' -I ' . ale#Escape(ale#gradle#GetInitPath())
11   \   . ' -q printClasspath'
12
13   let g:gradle_init_path = ale#path#Simplify(g:dir . '../../autoload/ale/gradle/init.gradle')
14
15 After:
16   Restore
17
18   unlet! g:gradle_init_path
19   unlet! g:command_tail
20
21   call ale#test#RestoreDirectory()
22   call ale#linter#Reset()
23
24 Execute(Should return 'gradlew' command if project includes gradle wapper):
25   call ale#test#SetFilename('test-files/gradle/wrapped-project/src/main/kotlin/dummy.kt')
26
27   AssertEqual
28   \ [
29   \   ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project'),
30   \   ale#Escape(ale#path#Simplify(g:dir . '/test-files/gradle/wrapped-project/gradlew'))
31   \   . g:command_tail,
32   \ ],
33   \ ale#gradle#BuildClasspathCommand(bufnr(''))
34
35 Execute(Should return 'gradle' command if project does not include gradle wapper):
36   call ale#test#SetFilename('test-files/gradle/unwrapped-project/src/main/kotlin/dummy.kt')
37   let $PATH .= (has('win32') ? ';' : ':')
38   \ . ale#path#Simplify(g:dir . '/test-files/gradle')
39
40   AssertEqual
41   \ [
42   \   ale#path#Simplify(g:dir . '/test-files/gradle/unwrapped-project'),
43   \   ale#Escape('gradle') . g:command_tail
44   \ ],
45   \ ale#gradle#BuildClasspathCommand(bufnr(''))
46
47 Execute(Should return empty string if gradle cannot be executed):
48   call ale#test#SetFilename('test-files/gradle/non-gradle-project/src/main/kotlin/dummy.kt')
49
50   AssertEqual
51   \ ['', ''],
52   \ ale#gradle#BuildClasspathCommand(bufnr(''))