summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-03-18 16:48:28 +0000
committerw0rp <devw0rp@gmail.com>2018-03-18 16:48:28 +0000
commitbdd8d2399f59f32c5531d168a1f9402d42d9b299 (patch)
tree8bb45194b57a0d9c8885cc526da66f6c21c357dd /test/command_callback
parentb08fdd16b879527885d3d8f9e21ba688b5f18763 (diff)
downloadale-bdd8d2399f59f32c5531d168a1f9402d42d9b299.zip
#416 Escape the tslint command
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_tslint_command_callback.vader16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/command_callback/test_tslint_command_callback.vader b/test/command_callback/test_tslint_command_callback.vader
index 4ad42fa5..edab72c8 100644
--- a/test/command_callback/test_tslint_command_callback.vader
+++ b/test/command_callback/test_tslint_command_callback.vader
@@ -17,7 +17,10 @@ Before:
After:
Restore
+ unlet! b:ale_typescript_tslint_executable
+ unlet! b:ale_typescript_tslint_config_path
unlet! b:ale_typescript_tslint_rules_dir
+ unlet! b:ale_typescript_tslint_use_global
call ale#test#RestoreDirectory()
call ale#linter#Reset()
@@ -25,7 +28,7 @@ After:
Execute(The default tslint command should be correct):
AssertEqual
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
- \ . 'tslint --format json %t',
+ \ . ale#Escape('tslint') . ' --format json %t',
\ ale_linters#typescript#tslint#GetCommand(bufnr(''))
Execute(The rules directory option should be included if set):
@@ -33,7 +36,16 @@ Execute(The rules directory option should be included if set):
AssertEqual
\ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
- \ . 'tslint --format json'
+ \ . ale#Escape('tslint') . ' --format json'
\ . ' -r ' . ale#Escape('/foo/bar')
\ . ' %t',
\ ale_linters#typescript#tslint#GetCommand(bufnr(''))
+
+Execute(The executable should be configurable and escaped):
+ let b:ale_typescript_tslint_executable = 'foo bar'
+
+ AssertEqual 'foo bar', ale_linters#typescript#tslint#GetExecutable(bufnr(''))
+ AssertEqual
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ . ale#Escape('foo bar') . ' --format json %t',
+ \ ale_linters#typescript#tslint#GetCommand(bufnr(''))