summaryrefslogtreecommitdiff
path: root/test/handler/test_ansible_lint_handler.vader
blob: b14b1f635b8f708903705c96cfb59f5a301002cd (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
Before:
    runtime ale_linters/ansible/ansible_lint.vim
    call ale#test#SetFilename('main.yml')

After:
    call ale#linter#Reset()

Execute(The ansible-lint handler should handle basic errors):
  AssertEqual
  \ [
  \   {
  \    'lnum': 35,
  \    'col': 0,
  \    'type': 'E',
  \    'text': 'EANSIBLE0002: Trailing whitespace',
  \   },
  \ ],
  \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [
  \   '/tmp/vxepmGL/1/main.yml:35: [EANSIBLE0002] Trailing whitespace',
  \ ])

Execute (The ansible-lint handler should handle names with spaces):
  AssertEqual
  \ [
  \   {
  \     'lnum': 6,
  \     'col': 6,
  \     'type': 'E',
  \     'text': 'E111: indentation is not a multiple of four',
  \   },
  \ ],
  \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [
  \   '/tmp/vxepm GL/1/main.yml:6:6: E111 indentation is not a multiple of four',
  \ ])

Execute (The ansible-lint handler should ignore errors from other files):
  AssertEqual
  \ [
  \ ],
  \ ale_linters#ansible#ansible_lint#Handle(bufnr(''), [
  \   '/foo/bar/roles/main.yml:6:6: E111 indentation is not a multiple of four',
  \ ])