summaryrefslogtreecommitdiff
path: root/test/command_callback/test_terraform_tflint_command_callback.vader
blob: a4ae56b03a96c5e6893114c5449ac14010283b9f (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
Before:
  Save g:ale_terraform_tflint_executable
  Save g:ale_terraform_tflint_options

  runtime ale_linters/terraform/tflint.vim

After:
  Restore

  call ale#linter#Reset()

Execute(The default executable should be configurable):
  AssertEqual 'tflint', ale_linters#terraform#tflint#GetExecutable(bufnr(''))

  let g:ale_terraform_tflint_executable = 'asdf'

  AssertEqual 'asdf', ale_linters#terraform#tflint#GetExecutable(bufnr(''))

Execute(The default command should be good):
  let g:ale_terraform_tflint_executable = 'tflint'
  AssertEqual
  \ ale#Escape('tflint') . ' -f json %t',
  \ ale_linters#terraform#tflint#GetCommand(bufnr(''))

Execute(Overriding things should work):
  let g:ale_terraform_tflint_executable = 'fnord'
  let g:ale_terraform_tflint_options = '--whatever'
  AssertEqual
  \ ale#Escape('fnord') . ' --whatever -f json %t',
  \ ale_linters#terraform#tflint#GetCommand(bufnr(''))