From a42999a639b2916b769a85f37d037be314d9d61b Mon Sep 17 00:00:00 2001 From: w0rp Date: Sun, 15 Jul 2018 18:24:53 +0100 Subject: Massively reduce the amount of code needed for linter tests --- .../test_cucumber_command_callback.vader | 23 ++++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'test/command_callback/test_cucumber_command_callback.vader') diff --git a/test/command_callback/test_cucumber_command_callback.vader b/test/command_callback/test_cucumber_command_callback.vader index d09a5712..7a8457fc 100644 --- a/test/command_callback/test_cucumber_command_callback.vader +++ b/test/command_callback/test_cucumber_command_callback.vader @@ -1,25 +1,18 @@ Before: - runtime ale_linters/ruby/rubocop.vim - call ale#test#SetDirectory('/testplugin/test/') + call ale#assert#SetUpLinterTest('cucumber', 'cucumber') After: - Restore - - call ale#linter#Reset() - call ale#test#RestoreDirectory() + call ale#assert#TearDownLinterTest() Execute(Should require the nearest features dir, if one is found): - call ale#test#SetFilename('cucumber_fixtures/features/cuke.feature') + call ale#test#SetFilename('../cucumber_fixtures/features/cuke.feature') - AssertEqual - \ 'cucumber --dry-run --quiet --strict --format=json ' - \ . '-r ' . ale#Escape(ale#path#Simplify(g:dir . '/cucumber_fixtures/features/')) . ' %t', - \ ale_linters#cucumber#cucumber#GetCommand(bufnr('')) + AssertLinter 'cucumber', + \ 'cucumber --dry-run --quiet --strict --format=json ' + \ . '-r ' . ale#Escape(ale#path#Simplify(g:dir . '/../cucumber_fixtures/features/')) . ' %t' Execute(Should require nothing if no features dir is found): call ale#test#SetFilename('something/without/a/features/dir') - AssertEqual - \ 'cucumber --dry-run --quiet --strict --format=json ' - \ . ' %t', - \ ale_linters#cucumber#cucumber#GetCommand(bufnr('')) + AssertLinter 'cucumber', + \ 'cucumber --dry-run --quiet --strict --format=json %t' -- cgit v1.2.3