Add cucumber checker for cucumber files

For now, it only detects undefined steps. The nearest `features` dir
above the buffer file is loaded, so step definitions should be found
correctly.

Tested only with Cucumber for Ruby, but it should work for any cucumber
that follows a substantially similar directory structure.
This commit is contained in:
Eddie Lebow
2018-04-17 00:29:13 -04:00
parent fb720251bf
commit 1e6651e0a0
7 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
Before:
runtime ale_linters/ruby/rubocop.vim
call ale#test#SetDirectory('/testplugin/test/')
After:
Restore
call ale#linter#Reset()
call ale#test#RestoreDirectory()
Execute(Should require the nearest features dir, if one is found):
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(''))
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(''))