ale/test/linter/test_remark_lint.vader

38 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-07-10 13:05:49 +00:00
Before:
" This is just one language for the linter.
call ale#assert#SetUpLinterTest('markdown', 'remark_lint')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
AssertLinter 'remark',
2018-07-10 13:06:43 +00:00
\ ale#Escape('remark') . ' --no-stdout --no-color'
2018-07-10 13:05:49 +00:00
Execute(The executable should be configurable):
let b:ale_markdown_remark_lint_executable = 'foobar'
AssertLinter 'foobar',
2018-07-10 13:06:43 +00:00
\ ale#Escape('foobar') . ' --no-stdout --no-color'
2018-07-10 13:05:49 +00:00
Execute(The options should be configurable):
let b:ale_markdown_remark_lint_options = '--something'
AssertLinter 'remark',
2018-07-10 13:06:43 +00:00
\ ale#Escape('remark') . ' --something --no-stdout --no-color'
2018-07-10 13:05:49 +00:00
Execute(The local executable from .bin should be used if available):
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
2018-07-10 13:05:49 +00:00
AssertLinter
\ ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'),
\ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/remark_lint/with_bin_path/node_modules/.bin/remark'))
2018-07-10 13:06:43 +00:00
\ . ' --no-stdout --no-color'
2018-07-10 13:05:49 +00:00
Execute(The global executable should be used if the option is set):
2018-07-10 13:05:49 +00:00
let b:ale_markdown_remark_lint_use_global = 1
call ale#test#SetFilename('../test-files/remark_lint/with_bin_path/foo.md')
2018-07-10 13:05:49 +00:00
AssertLinter 'remark', ale#Escape('remark')
2018-07-10 13:06:43 +00:00
\ . ' --no-stdout --no-color'