Permalink
Browse files

Support turnip

Closes #150.
  • Loading branch information...
1 parent d46ddd8 commit c78a2380dd079309aea0ebae3c154c627ab01ebe @tpope committed Apr 2, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 autoload/rails.vim
View
@@ -710,6 +710,8 @@ function! s:readable_calculate_file_type() dict abort
let r = 'cucumber-steps'
elseif f =~ '\<features/.*\.rb$'
let r = 'cucumber'
+ elseif f =~ '\<spec/.*\.feature$'
+ let r = 'turnip-feature'
elseif f =~ '\<\%(test\|spec\)/fixtures\>'
if e == "yml"
let r = "fixtures-yaml"
@@ -787,6 +789,7 @@ function! s:app_has(feature) dict
\'test': 'test/',
\'spec': 'spec/',
\'cucumber': 'features/',
+ \'turnip': 'spec/acceptance/',
\'sass': 'public/stylesheets/sass/',
\'lesscss': 'app/stylesheets/',
\'coffee': 'app/scripts/'}
@@ -2328,6 +2331,9 @@ function! s:integrationtestList(A,L,P)
if rails#app().has('cucumber')
let found += rails#app().relglob("features/","**/*",".feature")
endif
+ if rails#app().has('turnip')
+ let found += rails#app().relglob("spec/acceptance/","**/*",".feature")
+ endif
return s:completion_filter(found,a:A)
endfunction
@@ -2782,7 +2788,7 @@ function! s:integrationtestEdit(cmd,...)
else
let cmd = s:findcmdfor(a:cmd)
endif
- let tests = [['test/integration/','_test.rb'], [ 'spec/requests/','_spec.rb'], [ 'spec/integration/','_spec.rb'], [ 'features/','.feature']]
+ let tests = [['test/integration/','_test.rb'], ['spec/requests/','_spec.rb'], ['spec/integration/','_spec.rb'], ['features/','.feature'], ['spec/acceptance/','.feature']]
call filter(tests, 'isdirectory(rails#app().path(v:val[0]))')
if empty(tests)
let tests = [['test/integration/','_test.rb']]

0 comments on commit c78a238

Please sign in to comment.