diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_rust_rls_callbacks.vader | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_rust_rls_callbacks.vader')
-rw-r--r-- | test/command_callback/test_rust_rls_callbacks.vader | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/test/command_callback/test_rust_rls_callbacks.vader b/test/command_callback/test_rust_rls_callbacks.vader index 16bde98a..a710161d 100644 --- a/test/command_callback/test_rust_rls_callbacks.vader +++ b/test/command_callback/test_rust_rls_callbacks.vader @@ -1,45 +1,25 @@ Before: - Save g:ale_rust_rls_executable - Save g:ale_rust_rls_toolchain - - unlet! g:ale_rust_rls_executable - unlet! g:ale_rust_rls_toolchain - - runtime ale_linters/rust/rls.vim - - call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#assert#SetUpLinterTest('rust', 'rls') After: - Restore - - call ale#test#RestoreDirectory() - call ale#linter#Reset() + call ale#assert#TearDownLinterTest() Execute(The default executable path should be correct): - AssertEqual 'rls', ale_linters#rust#rls#GetExecutable(bufnr('')) - AssertEqual - \ ale#Escape('rls') . ' +' . ale#Escape('nightly'), - \ ale_linters#rust#rls#GetCommand(bufnr('')) + AssertLinter 'rls', ale#Escape('rls') . ' +' . ale#Escape('nightly') Execute(The toolchain should be configurable): let g:ale_rust_rls_toolchain = 'stable' - AssertEqual - \ ale#Escape('rls') . ' +' . ale#Escape('stable'), - \ ale_linters#rust#rls#GetCommand(bufnr('')) + AssertLinter 'rls', ale#Escape('rls') . ' +' . ale#Escape('stable') Execute(The toolchain should be ommitted if not given): let g:ale_rust_rls_toolchain = '' - AssertEqual - \ ale#Escape('rls'), - \ ale_linters#rust#rls#GetCommand(bufnr('')) + AssertLinter 'rls', ale#Escape('rls') Execute(The project root should be detected correctly): - AssertEqual '', ale_linters#rust#rls#GetProjectRoot(bufnr('')) + AssertLSPProject '' call ale#test#SetFilename('rust-rls-project/test.rs') - AssertEqual - \ ale#path#Simplify(g:dir . '/rust-rls-project'), - \ ale_linters#rust#rls#GetProjectRoot(bufnr('')) + AssertLSPProject ale#path#Simplify(g:dir . '/rust-rls-project') |