/ test / handler / test_spectral_handler.vader
test_spectral_handler.vader
 1  Before:
 2    runtime ale_linters/yaml/spectral.vim
 3  
 4  After:
 5    call ale#linter#Reset()
 6  
 7  Execute(spectral handler should parse lines correctly):
 8    AssertEqual
 9    \ [
10    \   {
11    \     'lnum': 1,
12    \     'col': 1,
13    \     'code': 'oas3-api-servers',
14    \     'text': 'OpenAPI `servers` must be present and non-empty array.',
15    \     'type': 'W'
16    \   },
17    \   {
18    \     'lnum': 1,
19    \     'col': 1,
20    \     'code': 'oas3-schema',
21    \     'text': 'Object should have required property `paths`.',
22    \     'type': 'E'
23    \   },
24    \   {
25    \     'lnum': 1,
26    \     'col': 1,
27    \     'code': 'openapi-tags',
28    \     'text': 'OpenAPI object should have non-empty `tags` array.',
29    \     'type': 'W'
30    \   },
31    \   {
32    \     'lnum': 3,
33    \     'col': 6,
34    \     'code': 'info-contact',
35    \     'text': 'Info object should contain `contact` object.',
36    \     'type': 'W'
37    \   },
38    \   {
39    \     'lnum': 3,
40    \     'col': 6,
41    \     'code': 'oas3-schema',
42    \     'text': '`info` property should have required property `version`.',
43    \     'type': 'E'
44    \   },
45    \ ],
46    \ ale#handlers#spectral#HandleSpectralOutput(bufnr(''), [
47    \   'openapi.yml:1:1 warning oas3-api-servers "OpenAPI `servers` must be present and non-empty array."',
48    \   'openapi.yml:1:1 error oas3-schema "Object should have required property `paths`."',
49    \   'openapi.yml:1:1 warning openapi-tags "OpenAPI object should have non-empty `tags` array."',
50    \   'openapi.yml:3:6 warning info-contact "Info object should contain `contact` object."',
51    \   'openapi.yml:3:6 error oas3-schema "`info` property should have required property `version`."',
52    \ ])