summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-04-07 15:34:39 +0100
committerw0rp <devw0rp@gmail.com>2019-04-07 15:34:39 +0100
commite85eb824016a0ca4217d41cc2ec603ff22a3b74d (patch)
tree46e5ffc641820d765bc5c8898fe56154b23e9eeb /test
parent3bebcb5d48a7150f5a318952ee309acb67fb376d (diff)
downloadale-e85eb824016a0ca4217d41cc2ec603ff22a3b74d.zip
#2132 - Implement feature tests with ale#Has
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_elixir_ls_command_callbacks.vader23
-rw-r--r--test/fixers/test_prettier_fixer_callback.vader2
-rw-r--r--test/test_ale_has.vader7
-rw-r--r--test/test_eslint_executable_detection.vader1
-rw-r--r--test/test_jsonlint_executable_detection.vader1
-rw-r--r--test/test_swiftlint_executable_detection.vader1
6 files changed, 18 insertions, 17 deletions
diff --git a/test/command_callback/test_elixir_ls_command_callbacks.vader b/test/command_callback/test_elixir_ls_command_callbacks.vader
index ca785054..41a5bc34 100644
--- a/test/command_callback/test_elixir_ls_command_callbacks.vader
+++ b/test/command_callback/test_elixir_ls_command_callbacks.vader
@@ -1,25 +1,24 @@
Before:
call ale#assert#SetUpLinterTest('elixir', 'elixir_ls')
- let g:ale_has_override['win32'] = 0
-
After:
- let g:ale_has_override = {}
-
call ale#assert#TearDownLinterTest()
-Execute(should set correct defaults (unix)):
- AssertLinter 'elixir-ls/language_server.sh', 'elixir-ls/language_server.sh'
-
-Execute(should set correct defaults (win32)):
- let g:ale_has_override['win32'] = 1
-
- AssertLinter 'elixir-ls\language_server.bat', 'elixir-ls\language_server.bat'
+Execute(should set correct defaults):
+ if has('win32')
+ AssertLinter 'elixir-ls\language_server.bat', 'elixir-ls\language_server.bat'
+ else
+ AssertLinter 'elixir-ls/language_server.sh', 'elixir-ls/language_server.sh'
+ endif
Execute(should configure elixir-ls release location):
let b:ale_elixir_elixir_ls_release = 'boo'
- AssertLinter 'boo/language_server.sh', 'boo/language_server.sh'
+ if has('win32')
+ AssertLinter 'boo\language_server.bat', 'boo\language_server.bat'
+ else
+ AssertLinter 'boo/language_server.sh', 'boo/language_server.sh'
+ endif
Execute(should set correct LSP values):
call ale#test#SetFilename('elixir_paths/umbrella_project/apps/app1/lib/app.ex')
diff --git a/test/fixers/test_prettier_fixer_callback.vader b/test/fixers/test_prettier_fixer_callback.vader
index 02bae9c1..9be161ac 100644
--- a/test/fixers/test_prettier_fixer_callback.vader
+++ b/test/fixers/test_prettier_fixer_callback.vader
@@ -8,8 +8,6 @@ Before:
After:
call ale#assert#TearDownFixerTest()
- let g:ale_has_override = {}
-
Execute(The prettier callback should return the correct default values):
call ale#test#SetFilename('../prettier-test-files/testfile.js')
diff --git a/test/test_ale_has.vader b/test/test_ale_has.vader
new file mode 100644
index 00000000..eb1da039
--- /dev/null
+++ b/test/test_ale_has.vader
@@ -0,0 +1,7 @@
+Execute(Checks for versions below the current version should succeed):
+ AssertEqual 1, ale#Has('ale-2.4.0')
+ AssertEqual 1, ale#Has('ALE-2.2.1')
+ AssertEqual 1, ale#Has('ALE-1.0.0')
+
+Execute(Checks for newer versions should fail):
+ AssertEqual 0, ale#Has('ALE-20.0.0')
diff --git a/test/test_eslint_executable_detection.vader b/test/test_eslint_executable_detection.vader
index 0d12e665..5599576e 100644
--- a/test/test_eslint_executable_detection.vader
+++ b/test/test_eslint_executable_detection.vader
@@ -6,7 +6,6 @@ Before:
runtime ale_linters/javascript/eslint.vim
After:
- let g:ale_has_override = {}
let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_use_global = 0
diff --git a/test/test_jsonlint_executable_detection.vader b/test/test_jsonlint_executable_detection.vader
index bd391b47..de52f846 100644
--- a/test/test_jsonlint_executable_detection.vader
+++ b/test/test_jsonlint_executable_detection.vader
@@ -4,7 +4,6 @@ Before:
runtime ale_linters/json/jsonlint.vim
After:
- let g:ale_has_override = {}
let g:ale_json_jsonlint_executable = 'jsonlint'
let g:ale_json_jsonlint_use_global = 0
diff --git a/test/test_swiftlint_executable_detection.vader b/test/test_swiftlint_executable_detection.vader
index a8e14c84..dfd4930b 100644
--- a/test/test_swiftlint_executable_detection.vader
+++ b/test/test_swiftlint_executable_detection.vader
@@ -6,7 +6,6 @@ Before:
runtime ale_linters/swift/swiftlint.vim
After:
- let g:ale_has_override = {}
let g:ale_swift_swiftlint_executable = 'swiftlint'
let g:ale_swift_swiftlint_use_global = 0