summaryrefslogtreecommitdiff
path: root/test/test_elm_executable_detection.vader
blob: c17d1bbca63222ba3e86d3cbd75674efd54c352e (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
Before:
  call ale#test#SetDirectory('/testplugin/test')
  runtime ale_linters/elm/make.vim

After:
  unlet! g:ale_elm_use_global
  unlet! g:ale_elm_executable

  call ale#test#RestoreDirectory()

Execute(should get valid executable with default params):
  call ale#test#SetFilename('elm-test-files/app/testfile.elm')

  AssertEqual
  \ ale#path#Simplify(g:dir . '/elm-test-files/app/node_modules/.bin/elm'),
  \ ale_linters#elm#make#GetExecutable(bufnr(''))

Execute(should get valid executable with 'use_global' params):
  let g:ale_elm_use_global = 1

  call ale#test#SetFilename('elm-test-files/app/testfile.elm')

  AssertEqual
  \ 'elm',
  \ ale_linters#elm#make#GetExecutable(bufnr(''))

Execute(should get valid executable with 'use_global' and 'executable' params):
  let g:ale_elm_executable = 'other-elm'
  let g:ale_elm_use_global = 1

  call ale#test#SetFilename('elm-test-files/app/testfile.elm')

  AssertEqual
  \ 'other-elm',
  \ ale_linters#elm#make#GetExecutable(bufnr(''))