summaryrefslogtreecommitdiff
path: root/test/command_callback/test_slimlint_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-10-05 22:31:00 +0100
committerw0rp <devw0rp@gmail.com>2017-10-05 22:31:09 +0100
commit47577564a2294668d7997b261e17fd97f0dd1fe6 (patch)
tree58ae1e9bbe104a528a888e83e7f8d0e9e5155b9f /test/command_callback/test_slimlint_command_callback.vader
parent25045641fbe92d175f2cd322497c9796d612782a (diff)
downloadale-47577564a2294668d7997b261e17fd97f0dd1fe6.zip
Get more command callback tests to pass on Windows
Diffstat (limited to 'test/command_callback/test_slimlint_command_callback.vader')
-rw-r--r--test/command_callback/test_slimlint_command_callback.vader32
1 files changed, 18 insertions, 14 deletions
diff --git a/test/command_callback/test_slimlint_command_callback.vader b/test/command_callback/test_slimlint_command_callback.vader
index 98fd9a83..d4dad4c4 100644
--- a/test/command_callback/test_slimlint_command_callback.vader
+++ b/test/command_callback/test_slimlint_command_callback.vader
@@ -9,8 +9,7 @@ After:
Restore
unlet! g:default_command
-
- let g:ale_has_override = {}
+ unlet! b:conf
call ale#linter#Reset()
call ale#test#RestoreDirectory()
@@ -21,15 +20,20 @@ Execute(The default command should be correct):
Execute(The command should have the .rubocop.yml prepended as an env var if one exists):
call ale#test#SetFilename('../slimlint-test-files/subdir/file.slim')
- AssertEqual
- \ 'SLIM_LINT_RUBOCOP_CONF=''/testplugin/test/slimlint-test-files/.rubocop.yml'' ' . g:default_command,
- \ ale_linters#slim#slimlint#GetCommand(bufnr(''))
-
-Execute(The command should have the .rubocop.yml prepended as an env var if one exists on win32):
- call ale#test#SetFilename('../slimlint-test-files/subdir/file.slim')
-
- let g:ale_has_override['win32'] = 1
-
- AssertEqual
- \ 'set SLIM_LINT_RUBOCOP_CONF=''/testplugin/test/slimlint-test-files/.rubocop.yml'' && ' . g:default_command,
- \ ale_linters#slim#slimlint#GetCommand(bufnr(''))
+ let b:conf = ale#path#Winify(g:dir . '/../slimlint-test-files/.rubocop.yml')
+
+ if has('win32')
+ " Windows uses 'set var=... && command'
+ AssertEqual
+ \ 'set SLIM_LINT_RUBOCOP_CONF='
+ \ . ale#Escape(b:conf)
+ \ . ' && ' . g:default_command,
+ \ ale_linters#slim#slimlint#GetCommand(bufnr(''))
+ else
+ " Unix uses 'var=... command'
+ AssertEqual
+ \ 'SLIM_LINT_RUBOCOP_CONF='
+ \ . ale#Escape(b:conf)
+ \ . ' ' . g:default_command,
+ \ ale_linters#slim#slimlint#GetCommand(bufnr(''))
+ endif