diff options
Diffstat (limited to 'test/fixers/test_rustfmt_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_rustfmt_fixer_callback.vader | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/test/fixers/test_rustfmt_fixer_callback.vader b/test/fixers/test_rustfmt_fixer_callback.vader index 95c78dea..98761c94 100644 --- a/test/fixers/test_rustfmt_fixer_callback.vader +++ b/test/fixers/test_rustfmt_fixer_callback.vader @@ -1,34 +1,16 @@ Before: - Save g:ale_rust_rustfmt_executable - Save g:ale_rust_rustfmt_options - - " Use an invalid global executable, so we don't match it. - let g:ale_rust_rustfmt_executable = 'xxxinvalid' - let g:ale_rust_rustfmt_options = '' - - call ale#test#SetDirectory('/testplugin/test/fixers') + call ale#assert#SetUpFixerTest('rust', 'rustfmt') After: - Restore - - call ale#test#RestoreDirectory() + call ale#assert#TearDownFixerTest() Execute(The rustfmt callback should return the correct default values): - call ale#test#SetFilename('../rust_files/testfile.rs') + call ale#test#SetFilename('../test-files/rust/testfile.rs') - AssertEqual - \ { - \ 'command': ale#Escape('xxxinvalid'), - \ }, - \ ale#fixers#rustfmt#Fix(bufnr('')) + AssertFixer {'command': ale#Escape('rustfmt')} Execute(The rustfmt callback should include custom rustfmt options): let g:ale_rust_rustfmt_options = "--skip-children" - call ale#test#SetFilename('../rust_files/testfile.rs') + call ale#test#SetFilename('../test-files/rust/testfile.rs') - AssertEqual - \ { - \ 'command': ale#Escape('xxxinvalid') - \ . ' ' . g:ale_rust_rustfmt_options, - \ }, - \ ale#fixers#rustfmt#Fix(bufnr('')) + AssertFixer {'command': ale#Escape('rustfmt') . ' ' . g:ale_rust_rustfmt_options} |