Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow :Rake in views to run view specs

  • Loading branch information...
commit d74a364b2ffcc5733bf1514d219213d799d299c3 1 parent 42bb069
Tim Pope tpope authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 autoload/rails.vim
4 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')
Please sign in to comment.
Something went wrong with that request. Please try again.