Permalink
Browse files

Allow :Rake in views to run view specs

  • Loading branch information...
tpope committed Aug 12, 2010
1 parent 42bb069 commit d74a364b2ffcc5733bf1514d219213d799d299c3
Showing with 3 additions and 1 deletion.
  1. +3 −1 autoload/rails.vim
View
@@ -1282,8 +1282,10 @@ function! s:readable_default_rake_task(lnum) dict abort
else
return 'routes CONTROLLER='.self.controller_name()
endif
- elseif app.has('spec') && self.name() =~# '^app/.*\.rb' && app.has_file(s:sub(self.name(),'^app/(.*)\.rb$','spec/\1_spec.rb'))
+ elseif app.has('spec') && self.name() =~# '^app/.*\.\w\+$' && app.has_file(s:sub(self.name(),'^app/(.*)\.\w\+$','spec/\1_spec.rb'))
return 'spec SPEC="'.fnamemodify(s:sub(self.name(),'<app/','spec/'),':p:r').'_spec.rb"'
+ elseif app.has('spec') && self.name() =~# '^app/.*\.\w\+$' && app.has_file(s:sub(self.name(),'^app/(.*)$','spec/\1_spec.rb'))
+ return 'spec SPEC="'.fnamemodify(s:sub(self.name(),'<app/','spec/'),':p').'_spec.rb"'
elseif self.type_name('model')
return 'test:units TEST="'.fnamemodify(s:sub(self.name(),'<app/models/','test/unit/'),':p:r').'_test.rb"'
elseif self.type_name('api','mailer')

0 comments on commit d74a364

Please sign in to comment.