forked from vim-test/vim-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbehave.vim
More file actions
33 lines (27 loc) · 818 Bytes
/
behave.vim
File metadata and controls
33 lines (27 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
if !exists('g:test#python#behave#file_pattern')
let g:test#python#behave#file_pattern = '\v.feature$'
endif
function! test#python#behave#test_file(file) abort
if a:file =~# g:test#python#behave#file_pattern
return !empty(glob('features/**/*.py'))
endif
endfunction
function! test#python#behave#build_position(type, position) abort
if a:type ==# 'nearest'
return [a:position['file'] . ':' . a:position['line']]
elseif a:type ==# 'file'
return [a:position['file']]
else
return []
endif
endfunction
function! test#python#behave#build_args(args, color) abort
let args = a:args
if !a:color
let args = ['--no-color'] + args
endif
return args
endfunction
function! test#python#behave#executable() abort
return 'behave'
endfunction