summaryrefslogtreecommitdiff
path: root/test/test_ant_build_classpath_command.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2021-03-01 20:11:10 +0000
committerw0rp <devw0rp@gmail.com>2021-03-01 20:11:10 +0000
commit9fe7b1fe6a23fb55e6d782293585d58193123f59 (patch)
tree0403deb70011aee7be08e586b10b5828cf69499e /test/test_ant_build_classpath_command.vader
parent48fab99a0ab793e1b9607795c21659f12bd6947f (diff)
downloadale-9fe7b1fe6a23fb55e6d782293585d58193123f59.zip
Close #2281 - Separate cwd commands from commands
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
Diffstat (limited to 'test/test_ant_build_classpath_command.vader')
-rw-r--r--test/test_ant_build_classpath_command.vader22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/test_ant_build_classpath_command.vader b/test/test_ant_build_classpath_command.vader
index 5542a9d8..72a7688d 100644
--- a/test/test_ant_build_classpath_command.vader
+++ b/test/test_ant_build_classpath_command.vader
@@ -5,25 +5,23 @@ Before:
Save $PATH
let $PATH = ale#path#Simplify(g:dir . '/ant-test-files/bin')
- let g:valid_project = 'ant-test-files/ant-project'
- let g:invalid_project = 'ant-test-files/non-ant-project'
- let g:command_tail = ' classpath' . ' -S' . ' -q'
-
After:
Restore
- unlet! g:command_tail
- unlet! g:valid_project
- unlet! g:invalid_project
-
call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(Should return `cd '[dir]' && 'ant' classpath -S -q`):
- call ale#test#SetFilename(valid_project . '/Main.java')
+ call ale#test#SetFilename('ant-test-files/ant-project/Main.java')
AssertEqual
- \ ale#path#CdString(ale#path#Simplify(g:dir . '/ant-test-files/ant-project'))
- \ . ale#Escape('ant')
- \ . g:command_tail,
+ \ [
+ \ ale#path#Simplify(g:dir . '/ant-test-files/ant-project'),
+ \ ale#Escape('ant') . ' classpath' . ' -S' . ' -q',
+ \ ],
\ ale#ant#BuildClasspathCommand(bufnr(''))
+
+Execute(Should return empty string if ant cannot be executed):
+ call ale#test#SetFilename('ant-test-files/not-an-ant-project/Main.java')
+
+ AssertEqual ['', ''], ale#ant#BuildClasspathCommand(bufnr(''))