Very basic Midje alternate

This commit is contained in:
Neil Kirsopp 2014-01-14 13:51:18 +00:00 committed by Tim Pope
parent ef422f66e2
commit b92a9730f0

View File

@ -1177,8 +1177,11 @@ function! fireplace#alternates() abort
let alt = [substitute(ns, '\.test\.', '.', '')]
elseif ns =~# '-spec$'
let alt = [ns[0:-6], ns . '-test']
elseif ns =~# '\.t-\([^\.]\)'
let alt = [substitute(ns, '\.t-\([^\.]\)', '\.\1', '')]
else
let alt = [ns . '-test', substitute(ns, '\.', '.test.', ''), ns . '-spec']
let alt = [ns . '-test', substitute(ns, '\.', '.test.', ''), ns . '-spec',
\ substitute(ns, '\(.*\)\.\(.*\)', '\1.t-\2', '')]
endif
return map(alt, 'tr(v:val, ".-", "/_") . ".clj"')
endfunction