summaryrefslogtreecommitdiff
path: root/test/test_prepare_command.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-10 21:35:35 +0100
committerw0rp <devw0rp@gmail.com>2017-07-10 21:35:35 +0100
commit751d965265c087a582e8e89bdec1ebcb018a7d6a (patch)
treefefa6cd639cc2e9e8dca80adabeb5f81c8ea9c2f /test/test_prepare_command.vader
parentb44f6053d1faffa47191009f84dc36d14ebc3992 (diff)
downloadale-751d965265c087a582e8e89bdec1ebcb018a7d6a.zip
Fix #749 - Use /bin/sh when the shell is fish
Diffstat (limited to 'test/test_prepare_command.vader')
-rw-r--r--test/test_prepare_command.vader37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/test_prepare_command.vader b/test/test_prepare_command.vader
new file mode 100644
index 00000000..5707be72
--- /dev/null
+++ b/test/test_prepare_command.vader
@@ -0,0 +1,37 @@
+Before:
+ Save &shell
+ Save &shellcmdflag
+
+After:
+ Restore
+ let g:ale_has_override = {}
+
+Execute(sh should be used when the shell is fish):
+ " Set something else, so we will replace that too.
+ let &shellcmdflag = '-f'
+
+ let &shell = 'fish'
+
+ AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
+
+ let &shell = '/usr/bin/fish'
+
+ AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
+
+ let &shell = '/usr/local/bin/fish'
+
+ AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
+
+Execute(Other shells should be used when set):
+ let &shell = '/bin/bash'
+ let &shellcmdflag = '-c'
+
+ AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
+
+Execute(cmd /c as a string should be used on Windows):
+ let &shell = 'who cares'
+ let &shellcmdflag = 'whatever'
+
+ let g:ale_has_override = {'win32': 1}
+
+ AssertEqual 'cmd /c foobar', ale#job#PrepareCommand('foobar')