summaryrefslogtreecommitdiff
path: root/test/linter/test_spectral.vader
blob: cfcf0987f0857dda3fcad593099d1dde97de3229 (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
Before:
  call ale#assert#SetUpLinterTest('yaml', 'spectral')

After:
  call ale#assert#TearDownLinterTest()

Execute(The yaml spectral command callback should return the correct default string):
  AssertLinter 'spectral', ale#Escape('spectral') . ' lint --ignore-unknown-format -q -f text %t'

Execute(The yaml spectral command callback should be configurable):
  let g:ale_yaml_spectral_executable = '~/.local/bin/spectral'

  AssertLinter '~/.local/bin/spectral',
  \ ale#Escape('~/.local/bin/spectral')
  \   . ' lint --ignore-unknown-format -q -f text %t'

Execute(The yaml spectral command callback should allow a global installation to be used):
  let g:ale_yaml_spectral_executable = '/usr/local/bin/spectral'
  let g:ale_yaml_spectral_use_global = 1

  AssertLinter '/usr/local/bin/spectral',
  \ ale#Escape('/usr/local/bin/spectral')
  \   . ' lint --ignore-unknown-format -q -f text %t'

Execute(The yaml spectral command callback should allow a local installation to be used):
  call ale#test#SetFilename('../test-files/spectral/openapi.yaml')

  AssertLinter
  \ ale#path#Simplify(g:dir . '/../test-files/spectral/node_modules/.bin/spectral'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/spectral/node_modules/.bin/spectral'))
  \   . ' lint --ignore-unknown-format -q -f text %t'