blob: 9f7d3450fd7a8ebbfc61f196147b0c785175f3c0 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
Before:
call ale#assert#SetUpLinterTest('terraform', 'terraform_ls')
After:
if isdirectory(g:dir . '/.terraform')
call delete(g:dir . '/.terraform', 'd')
endif
unlet! b:ale_terraform_terraform_executable
unlet! b:ale_terraform_ls_executable
unlet! b:ale_terraform_ls_options
call ale#assert#TearDownLinterTest()
Execute(Should send correct LSP language):
AssertLSPLanguage 'terraform'
Execute(Should load default executable):
AssertLinter 'terraform-ls',
\ ale#Escape('terraform-ls') . ' serve'
Execute(Should configure custom executable):
let b:ale_terraform_ls_executable = 'foo'
AssertLinter 'foo',
\ ale#Escape('foo') . ' serve'
Execute(Should ignore non-absolute custom terraform executable):
let b:ale_terraform_terraform_executable = 'terraform'
AssertLinter 'terraform-ls',
\ ale#Escape('terraform-ls') . ' serve'
Execute(Should set absolute custom terraform executable):
let b:ale_terraform_terraform_executable = '/bin/terraform'
AssertLinter 'terraform-ls',
\ ale#Escape('terraform-ls') . ' serve -tf-exec /bin/terraform'
Execute(Should set custom options):
let b:ale_terraform_ls_options = '--bar'
AssertLinter 'terraform-ls',
\ ale#Escape('terraform-ls') . ' serve --bar'
Execute(Should return current directory if it contains .terraform directory):
call mkdir(g:dir . '/.terraform')
AssertLSPProject g:dir
Execute(Should return nearest directory with .terraform if found in parent directory):
call ale#test#SetFilename('../test-files/terraform/main.tf')
let b:parent_dir = ale#path#Simplify(g:dir . '/..')
let b:tf_dir = b:parent_dir . '/.terraform'
if !isdirectory(b:tf_dir)
call mkdir(b:tf_dir)
endif
AssertLSPProject b:parent_dir
call delete(b:tf_dir, 'd')
unlet!b:parent_dir
unlet!b:tf_dir
|