diff options
author | harttle <yangjvn@126.com> | 2019-04-11 19:47:31 +0800 |
---|---|---|
committer | harttle <yangjvn@126.com> | 2019-04-11 19:47:31 +0800 |
commit | 4b6691f602e8574fb41b8e63d8d95f7c0ecbb878 (patch) | |
tree | 4a7a1c8e440753d73c106a604d8c3edc535529a9 /test/fixers/test_fecs_fixer_callback.vader | |
parent | d4841cedf22290a9746d220cd6682fac52262523 (diff) | |
download | ale-4b6691f602e8574fb41b8e63d8d95f7c0ecbb878.zip |
test: unit test for fecs fixer, fecs command
Diffstat (limited to 'test/fixers/test_fecs_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_fecs_fixer_callback.vader | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixers/test_fecs_fixer_callback.vader b/test/fixers/test_fecs_fixer_callback.vader new file mode 100644 index 00000000..809b4d46 --- /dev/null +++ b/test/fixers/test_fecs_fixer_callback.vader @@ -0,0 +1,26 @@ +Before: + call ale#assert#SetUpFixerTest('javascript', 'fecs') + runtime autoload/ale/handlers/fecs.vim + +After: + call ale#assert#TearDownFixerTest() + +Execute(The fecs fixer should respect to g:ale_javascript_fecs_executable): + let g:ale_javascript_fecs_executable = 'fecs_paths/fecs' + let g:ale_javascript_fecs_use_global = 1 + silent cd ../command_callback + let g:dir = getcwd() + + AssertEqual + \ { + \ 'command': ale#Escape(g:ale_javascript_fecs_executable) . ' format --replace=true %t', + \ 'read_temporary_file': 1, + \ }, + \ ale#fixers#fecs#Fix(bufnr('')) + +Execute(The fecs fixer should return 0 when executable not found): + let g:ale_javascript_fecs_executable = 'fecs-invalid' + let g:ale_javascript_fecs_use_global = 1 + AssertEqual + \ 0, + \ ale#fixers#fecs#Fix(bufnr('')) |