2021-01-30 06:41:40 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('terraform', 'terraform_ls')
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! b:ale_terraform_terraform_executable
|
|
|
|
unlet! b:ale_terraform_ls_executable
|
|
|
|
unlet! b:ale_terraform_ls_options
|
|
|
|
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(The terraform-ls language should be correct):
|
2021-01-30 06:41:40 +00:00
|
|
|
AssertLSPLanguage 'terraform'
|
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(The default terraform-ls command should be correct):
|
|
|
|
AssertLinter 'terraform-ls', ale#Escape('terraform-ls') . ' serve'
|
2021-01-30 06:41:40 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(The terrarform-ls executable and options should be configurable):
|
2021-01-30 06:41:40 +00:00
|
|
|
let b:ale_terraform_ls_executable = 'foo'
|
2023-09-16 21:22:01 +00:00
|
|
|
let b:ale_terraform_ls_options = '--bar'
|
|
|
|
|
|
|
|
AssertLinter 'foo', ale#Escape('foo') . ' serve --bar'
|
2021-01-30 06:41:40 +00:00
|
|
|
|
2023-09-16 21:22:01 +00:00
|
|
|
Execute(Should ignore non-absolute path custom terraform executables):
|
2021-01-30 06:41:40 +00:00
|
|
|
let b:ale_terraform_terraform_executable = 'terraform'
|
2023-09-16 21:22:01 +00:00
|
|
|
|
|
|
|
AssertLinter 'terraform-ls', ale#Escape('terraform-ls') . ' serve'
|
2021-01-30 06:41:40 +00:00
|
|
|
|
|
|
|
Execute(Should set absolute custom terraform executable):
|
|
|
|
let b:ale_terraform_terraform_executable = '/bin/terraform'
|
|
|
|
|
|
|
|
AssertLinter 'terraform-ls',
|
2023-09-16 21:22:01 +00:00
|
|
|
\ ale#Escape('terraform-ls') . ' serve -tf-exec /bin/terraform'
|
2021-01-30 06:41:40 +00:00
|
|
|
|
|
|
|
Execute(Should return nearest directory with .terraform if found in parent directory):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/terraform/main.tf')
|
2021-01-30 06:41:40 +00:00
|
|
|
|
2022-04-01 12:17:15 +00:00
|
|
|
AssertLSPProject ale#test#GetFilename('../test-files/terraform')
|