summaryrefslogtreecommitdiff
path: root/test/command_callback/test_rustc_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_rustc_command_callback.vader
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_rustc_command_callback.vader')
-rw-r--r--test/command_callback/test_rustc_command_callback.vader28
1 files changed, 6 insertions, 22 deletions
diff --git a/test/command_callback/test_rustc_command_callback.vader b/test/command_callback/test_rustc_command_callback.vader
index fe46c9ad..7ca02760 100644
--- a/test/command_callback/test_rustc_command_callback.vader
+++ b/test/command_callback/test_rustc_command_callback.vader
@@ -1,37 +1,21 @@
Before:
- Save g:ale_rust_rustc_options
-
- unlet! g:ale_rust_rustc_options
-
- runtime ale_linters/rust/rustc.vim
- call ale#test#SetDirectory('/testplugin/test/command_callback')
+ call ale#assert#SetUpLinterTest('rust', 'rustc')
After:
- Restore
-
- unlet! b:ale_rust_rustc_options
-
- call ale#test#RestoreDirectory()
- call ale#linter#Reset()
+ call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
- AssertEqual
- \ 'rustc --error-format=json -Z no-trans -',
- \ ale_linters#rust#rustc#RustcCommand(bufnr(''))
+ AssertLinter 'rustc', 'rustc --error-format=json -Z no-trans -'
Execute(The options should be configurable):
let b:ale_rust_rustc_options = '--foo'
- AssertEqual
- \ 'rustc --error-format=json --foo -',
- \ ale_linters#rust#rustc#RustcCommand(bufnr(''))
+ AssertLinter 'rustc', 'rustc --error-format=json --foo -'
Execute(Some default paths should be included when the project is a Cargo project):
call ale#test#SetFilename('cargo_paths/test.rs')
- AssertEqual
- \ 'rustc --error-format=json -Z no-trans'
+ AssertLinter 'rustc', 'rustc --error-format=json -Z no-trans'
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, 'cargo_paths/target/debug/deps'))
\ . ' -L ' . ale#Escape(ale#path#GetAbsPath(g:dir, 'cargo_paths/target/release/deps'))
- \ . ' -',
- \ ale_linters#rust#rustc#RustcCommand(bufnr(''))
+ \ . ' -'