summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden <holden@axoni.com>2018-12-28 11:58:55 -0500
committerHolden <holden@axoni.com>2018-12-28 11:58:55 -0500
commitc499825a0bc3f27d728e42b61ee25ec9a06644fa (patch)
tree47a81f0503238b24fc652902aa8f4b8d42f840b9
parent57a04701c3ac1d06efbf16f2ce184c37f0076d16 (diff)
downloadale-c499825a0bc3f27d728e42b61ee25ec9a06644fa.zip
add tests for ale_shell option
-rw-r--r--doc/ale.txt4
-rw-r--r--test/fix/test_ale_fix.vader2
-rw-r--r--test/lsp/test_lsp_command_formatting.vader2
-rw-r--r--test/test_prepare_command.vader7
4 files changed, 11 insertions, 4 deletions
diff --git a/doc/ale.txt b/doc/ale.txt
index 1535d89e..f6063718 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -1990,7 +1990,7 @@ g:ale_windows_node_executable_path *g:ale_windows_node_executable_path*
scripts are executed with whatever executable is configured with this
setting.
-g:ale_shell *g:ale_shell*
+g:ale_shell *g:ale_shell*
Type: |String|
Default: `'&shell'`
@@ -2000,7 +2000,7 @@ g:ale_shell *g:ale_shell*
which corresponds to the $SHELL environment variable. For example
if `$SHELL == '/bin/bash'`, but you want to use zsh, set `g:ale_shell = '/bin/zsh'.`
-g:ale_shell_arguments *g:ale_shell_arguments*
+g:ale_shell_arguments *g:ale_shell_arguments*
Type: |String|
Default: `'&shellcmdflag'`
diff --git a/test/fix/test_ale_fix.vader b/test/fix/test_ale_fix.vader
index 90407681..ac15bc05 100644
--- a/test/fix/test_ale_fix.vader
+++ b/test/fix/test_ale_fix.vader
@@ -26,7 +26,7 @@ Before:
augroup END
if !has('win32')
- let &shell = '/bin/bash'
+ let g:ale_shell = '/bin/bash'
endif
call ale#test#SetDirectory('/testplugin/test')
diff --git a/test/lsp/test_lsp_command_formatting.vader b/test/lsp/test_lsp_command_formatting.vader
index 9721f37f..33928291 100644
--- a/test/lsp/test_lsp_command_formatting.vader
+++ b/test/lsp/test_lsp_command_formatting.vader
@@ -31,6 +31,6 @@ Execute(Command formatting should be applied correctly for LSP linters):
\ g:args
else
AssertEqual
- \ ['true', [&shell, '-c', '''true'' --foo']],
+ \ ['true', [g:ale_shell, '-c', '''true'' --foo']],
\ g:args
endif
diff --git a/test/test_prepare_command.vader b/test/test_prepare_command.vader
index 75e4c0c6..2bdfd2cb 100644
--- a/test/test_prepare_command.vader
+++ b/test/test_prepare_command.vader
@@ -4,6 +4,7 @@ Before:
After:
Restore
+ let g:ale_shell = &shell
Execute(sh should be used when the shell is fish):
if !has('win32')
@@ -43,6 +44,7 @@ Execute(Other shells should be used when set):
if !has('win32')
let &shell = '/bin/bash'
let &shellcmdflag = '-c'
+ let g:ale_shell = &shell
AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), 'foobar')
endif
@@ -54,3 +56,8 @@ Execute(cmd /s/c as a string should be used on Windows):
AssertEqual 'cmd /s/c "foobar"', ale#job#PrepareCommand(bufnr(''), 'foobar')
endif
+
+Execute(Setting ale_shell should cause ale#job#PrepareCommand to use set shell):
+ let g:ale_shell = '/foo/bar'
+
+ AssertEqual ['/foo/bar', '-c', 'foobar'], ale#job#PrepareCommand(bufnr(''), "foobar")