]> git.madduck.net Git - etc/vim.git/blob - test/test_maven_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_maven_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/java/javac.vim
9   let g:expected_wrapper = ''
10   if has('unix')
11     let g:expected_wrapper = 'mvnw'
12   else
13     let g:expected_wrapper = 'mvnw.cmd'
14   endif
15
16 After:
17   Restore
18
19   unlet! g:expected_wrapper
20
21   call ale#test#RestoreDirectory()
22   call ale#linter#Reset()
23
24 Execute(Should use 'mvnw' in classpath command if available):
25   call ale#test#SetFilename('test-files/maven/maven-java-project/module1/src/main/java/dummy1.java')
26
27   AssertEqual
28   \ [
29   \   ale#path#Simplify(g:dir . '/test-files/maven/maven-java-project/module1'),
30   \   ale#Escape(ale#path#Simplify(g:dir . '/test-files/maven/maven-java-project/module1/' . g:expected_wrapper))
31   \   . ' dependency:build-classpath',
32   \ ],
33   \ ale#maven#BuildClasspathCommand(bufnr(''))
34
35 Execute(Should use 'mvn' in classpath command if it is executable and 'mvnw' is unavailable):
36   call ale#test#SetFilename('test-files/maven/maven-java-project/module2/src/main/java/dummy2.java')
37   let $PATH .= (has('win32') ? ';' : ':')
38   \ . ale#path#Simplify(g:dir . '/test-files/maven')
39
40   AssertEqual
41   \ [
42   \   ale#path#Simplify(g:dir . '/test-files/maven/maven-java-project/module2'),
43   \   ale#Escape('mvn')
44   \   . ' dependency:build-classpath',
45   \ ],
46   \ ale#maven#BuildClasspathCommand(bufnr(''))
47
48 Execute(Should return empty string if maven cannot be executed):
49   call ale#test#SetFilename('test-files/maven/non-maven-project/src/main/java/dummy.java')
50
51   AssertEqual
52   \ ['', ''],
53   \ ale#maven#BuildClasspathCommand(bufnr(''))