2017-07-17 19:28:21 +00:00
|
|
|
Before:
|
|
|
|
runtime ale_linters/yaml/swaglint.vim
|
2017-11-15 17:21:17 +00:00
|
|
|
|
2017-07-17 19:28:21 +00:00
|
|
|
call ale#test#SetDirectory('/testplugin/test/command_callback')
|
|
|
|
|
|
|
|
After:
|
|
|
|
let g:ale_yaml_swaglint_executable = 'swaglint'
|
|
|
|
let g:ale_yaml_swaglint_use_global = 0
|
|
|
|
|
2017-11-15 17:21:17 +00:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
2017-07-17 19:28:21 +00:00
|
|
|
Execute(The yaml swaglint command callback should return the correct default string):
|
|
|
|
AssertEqual 'swaglint',
|
|
|
|
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual 'swaglint -r compact --stdin',
|
|
|
|
\ ale_linters#yaml#swaglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The yaml swaglint command callback should be configurable):
|
|
|
|
let g:ale_yaml_swaglint_executable = '~/.local/bin/swaglint'
|
|
|
|
AssertEqual '~/.local/bin/swaglint',
|
|
|
|
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual '~/.local/bin/swaglint -r compact --stdin',
|
|
|
|
\ ale_linters#yaml#swaglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The yaml swaglint command callback should allow a global installation to be used):
|
|
|
|
let g:ale_yaml_swaglint_executable = '/usr/local/bin/swaglint'
|
|
|
|
let g:ale_yaml_swaglint_use_global = 1
|
|
|
|
AssertEqual '/usr/local/bin/swaglint',
|
|
|
|
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
|
|
|
AssertEqual '/usr/local/bin/swaglint -r compact --stdin',
|
|
|
|
\ ale_linters#yaml#swaglint#GetCommand(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The yaml swaglint command callback should allow a local installation to be used):
|
|
|
|
call ale#test#SetFilename('swaglint_paths/docs/swagger.yaml')
|
2017-10-05 21:31:00 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint'),
|
2017-07-17 19:28:21 +00:00
|
|
|
\ ale_linters#yaml#swaglint#GetExecutable(bufnr(''))
|
2017-10-05 21:31:00 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ ale#path#Winify(g:dir . '/swaglint_paths/node_modules/.bin/swaglint')
|
|
|
|
\ . ' -r compact --stdin',
|
2017-07-17 19:28:21 +00:00
|
|
|
\ ale_linters#yaml#swaglint#GetCommand(bufnr(''))
|