diff options
author | w0rp <devw0rp@gmail.com> | 2017-06-21 22:33:34 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-06-21 22:33:34 +0100 |
commit | dab6f39eb0b5d0dd77a8dc3fe58d0648d82696f7 (patch) | |
tree | 18faefa99cc56fee65db35c007c0e2e267166cc6 /test/test_phpcs_executable_detection.vader | |
parent | ab534c2995dabfb8adcdc62d0ac66ed1b1110f4c (diff) | |
download | ale-dab6f39eb0b5d0dd77a8dc3fe58d0648d82696f7.zip |
Fix some escaping and make some tests set filenames consistently
Diffstat (limited to 'test/test_phpcs_executable_detection.vader')
-rw-r--r-- | test/test_phpcs_executable_detection.vader | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/test/test_phpcs_executable_detection.vader b/test/test_phpcs_executable_detection.vader index 678606f8..72b7af0b 100644 --- a/test/test_phpcs_executable_detection.vader +++ b/test/test_phpcs_executable_detection.vader @@ -1,5 +1,9 @@ Before: + Save g:ale_php_phpcs_executable + Save g:ale_php_phpcs_use_global + let g:ale_php_phpcs_executable = 'phpcs_test' + let g:ale_php_phpcs_use_global = 0 silent! cd /testplugin/test let g:dir = getcwd() @@ -7,39 +11,32 @@ Before: runtime ale_linters/php/phpcs.vim After: - let g:ale_php_phpcs_executable = 'phpcs' - let g:ale_php_phpcs_use_global = 0 + Restore - silent execute 'cd ' . g:dir + silent execute 'cd ' . fnameescape(g:dir) unlet! g:dir call ale#linter#Reset() Execute(project with phpcs should use local by default): - silent noautocmd new phpcs-test-files/project-with-phpcs/vendor/bin/phpcs + call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php') AssertEqual \ g:dir . '/phpcs-test-files/project-with-phpcs/vendor/bin/phpcs', \ ale_linters#php#phpcs#GetExecutable(bufnr('')) - :q - Execute(use-global should override local detection): let g:ale_php_phpcs_use_global = 1 - silent noautocmd new phpcs-test-files/project-with-phpcs/vendor/bin/phpcs + call ale#test#SetFilename('phpcs-test-files/project-with-phpcs/foo/test.php') AssertEqual \ 'phpcs_test', \ ale_linters#php#phpcs#GetExecutable(bufnr('')) - :q - Execute(project without phpcs should use global): - silent noautocmd new phpcs-test-files/project-without-phpcs/vendor/bin/phpcs + call ale#test#SetFilename('phpcs-test-files/project-without-phpcs/foo/test.php') AssertEqual \ 'phpcs_test', \ ale_linters#php#phpcs#GetExecutable(bufnr('')) - - :q |