Skip to content

Commit bdc3238

Browse files
mwunschtpope
authored andcommitted
Map Rails 4 testing directories to rake tasks
This adds the Rails 4 idiom of creating test directories named "models" and "controllers" (in lieu of "unit" and "functional") to the pattern matches when running `:Rake`:, selecting the appropriate rake task to run. This allows those doing Rails 4 development to run `:Rake` and avoid falling down to the deprecated `test:recent`.
1 parent a041070 commit bdc3238

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/rails.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,9 +1386,9 @@ function! s:readable_default_rake_task(...) dict abort
13861386
let opts = ' TESTOPTS=-n'.method
13871387
endif
13881388
endif
1389-
if test =~# '^test/unit\>'
1389+
if test =~# '^test/\%(unit\|models\)\>'
13901390
return 'test:units TEST='.s:rquote(test).opts
1391-
elseif test =~# '^test/functional\>'
1391+
elseif test =~# '^test/\%(functional\|controllers\)\>'
13921392
return 'test:functionals TEST='.s:rquote(test).opts
13931393
elseif test =~# '^test/integration\>'
13941394
return 'test:integration TEST='.s:rquote(test).opts

0 commit comments

Comments
 (0)