summaryrefslogtreecommitdiff
path: root/test/test_gradle_find_executable.vader
blob: 054c21a8120764d984e17e15521c9e7784730cf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Before:
  Save $PATH
  Save $PATHEXT

  " Count the gradle executable without .exe as executable on Windows
  let $PATHEXT = '.'

  call ale#test#SetDirectory('/testplugin/test')
  runtime ale_linters/kotlin/kotlinc.vim

After:
  Restore

  call ale#test#RestoreDirectory()
  call ale#linter#Reset()

Execute(Should return 'gradlew' if found in parent directory):
  call ale#test#SetFilename('gradle-test-files/wrapped-project/src/main/kotlin/dummy.kt')

  AssertEqual
  \ ale#path#Winify(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 .= (has('win32') ? ';': ':') . ale#path#Winify(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(''))