diff options
author | w0rp <devw0rp@gmail.com> | 2017-09-11 00:47:27 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-11 00:47:27 +0100 |
commit | b6a487ccf9318e449a85bd5b43d7a81b9d17d2be (patch) | |
tree | 3fc370f84a5295994d38b54d2eef2468a1a0a9e2 /test/command_callback/test_perlcritic_command_callback.vader | |
parent | cb8a140141d6365f48e66dfaaaa8f9957f0dc832 (diff) | |
download | ale-b6a487ccf9318e449a85bd5b43d7a81b9d17d2be.zip |
Fix some random test issues for Windows
Diffstat (limited to 'test/command_callback/test_perlcritic_command_callback.vader')
-rw-r--r-- | test/command_callback/test_perlcritic_command_callback.vader | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/command_callback/test_perlcritic_command_callback.vader b/test/command_callback/test_perlcritic_command_callback.vader new file mode 100644 index 00000000..8f339d31 --- /dev/null +++ b/test/command_callback/test_perlcritic_command_callback.vader @@ -0,0 +1,59 @@ +Before: + Save g:ale_perl_perlcritic_profile + Save g:ale_perl_perlcritic_options + Save g:ale_perl_perlcritic_executable + Save g:ale_perl_perlcritic_showrules + + unlet! g:ale_perl_perlcritic_options + unlet! g:ale_perl_perlcritic_executable + unlet! g:ale_perl_perlcritic_showrules + let g:ale_perl_perlcritic_profile = '' + + runtime ale_linters/perl/perlcritic.vim + + call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#test#SetFilename('test.pl') + +After: + Restore + + unlet! b:ale_perl_perlcritic_profile + unlet! b:ale_perl_perlcritic_options + unlet! b:ale_perl_perlcritic_executable + unlet! b:ale_perl_perlcritic_showrules + unlet! b:readme_path + + call ale#test#RestoreDirectory() + call ale#linter#Reset() + +Execute(The command should be correct with g:ale_perl_perlcritic_showrules off): + let b:ale_perl_perlcritic_showrules = 0 + + AssertEqual + \ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor', + \ ale_linters#perl#perlcritic#GetCommand(bufnr('')) + +Execute(The command should be correct with g:ale_perl_perlcritic_showrules on): + let b:ale_perl_perlcritic_showrules = 1 + + AssertEqual + \ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m [%p]\n'' --nocolor', + \ ale_linters#perl#perlcritic#GetCommand(bufnr('')) + +Execute(The command search for the profile file when set): + let b:ale_perl_perlcritic_profile = 'README.md' + + let b:readme_path = ale#path#Winify(expand('%:p:h:h:h') . '/README.md') + + AssertEqual + \ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor' + \ . ' --profile ' . ale#Escape(b:readme_path), + \ ale_linters#perl#perlcritic#GetCommand(bufnr('')) + +Execute(Extra options should be set appropriately): + let b:ale_perl_perlcritic_options = 'beep boop' + + AssertEqual + \ ale#Escape('perlcritic') . ' --verbose ''%l:%c %m\n'' --nocolor' + \ . ' beep boop', + \ ale_linters#perl#perlcritic#GetCommand(bufnr('')) |