summaryrefslogtreecommitdiff
path: root/test/linter/test_alex.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2021-03-21 00:21:49 +0000
committerw0rp <devw0rp@gmail.com>2021-03-21 00:25:33 +0000
commitf7852dbd0a063d6d82ee17a5057fea53cb79b21d (patch)
tree00b98a3c668af9313eedd6936475c81eeef7e9b8 /test/linter/test_alex.vader
parent35caaecc9fc5822f0474e913d0b7655048fd30ee (diff)
downloadale-f7852dbd0a063d6d82ee17a5057fea53cb79b21d.zip
#3633 - Move linter tests into test/linter
Diffstat (limited to 'test/linter/test_alex.vader')
-rw-r--r--test/linter/test_alex.vader34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/linter/test_alex.vader b/test/linter/test_alex.vader
new file mode 100644
index 00000000..20e20301
--- /dev/null
+++ b/test/linter/test_alex.vader
@@ -0,0 +1,34 @@
+Before:
+ call ale#assert#SetUpLinterTest('tex', 'alex')
+ call ale#test#SetFilename('test_file.tex')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The global executable should be used when the local one cannot be found):
+ AssertLinter 'alex',
+ \ ale#Escape('alex') . ' %s --text',
+
+Execute(Should use the node_modules/.bin executable, if available):
+ call ale#test#SetFilename('../test-files/alex/node-modules/test_file.tex')
+
+ AssertLinter ale#path#Simplify(g:dir . '/../test-files/alex/node-modules/node_modules/.bin/alex'),
+ \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/alex/node-modules/node_modules/.bin/alex'))
+ \ . ' %s --text',
+
+Execute(Should use the node_modules/alex executable, if available):
+ call ale#test#SetFilename('../test-files/alex/node-modules-2/test_file.tex')
+
+ AssertLinter ale#path#Simplify(g:dir . '/../test-files/alex/node-modules-2/node_modules/alex/cli.js'),
+ \ (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/alex/node-modules-2/node_modules/alex/cli.js'))
+ \ . ' %s --text',
+
+Execute(Should let users configure a global executable and override local paths):
+ call ale#test#SetFilename('../test-files/write-good/node-modules-2/test_file.tex')
+
+ let g:ale_alex_executable = '/path/to/custom/alex'
+ let g:ale_alex_use_global = 1
+
+ AssertLinter '/path/to/custom/alex',
+ \ ale#Escape('/path/to/custom/alex') . ' %s --text'