Permalink
Browse files

Support minitest file types

  • Loading branch information...
1 parent 7698188 commit d83890f13813c40322b732514c87828a91967342 @tpope committed Sep 29, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 autoload/rails.vim
View
@@ -686,16 +686,18 @@ function! s:readable_calculate_file_type() dict abort
let r = "view-layout-" . e
elseif f =~ '\<app/views\>.*\.'
let r = "view-" . e
+ elseif f =~ '\<lib/.*\.rb$'
+ let r = 'lib'
elseif f =~ '\<test/unit/.*_test\.rb$'
let r = "test-unit"
elseif f =~ '\<test/functional/.*_test\.rb$'
let r = "test-functional"
elseif f =~ '\<test/integration/.*_test\.rb$'
let r = "test-integration"
+ elseif f =~ '\<test/\w*s/.*_test\.rb$'
+ let r = s:sub(f,'.*<test/(\w*)s/.*','test-\1')
elseif f =~ '\<spec/lib/.*_spec\.rb$'
let r = 'spec-lib'
- elseif f =~ '\<lib/.*\.rb$'
- let r = 'lib'
elseif f =~ '\<spec/\w*s/.*_spec\.rb$'
let r = s:sub(f,'.*<spec/(\w*)s/.*','spec-\1')
elseif f =~ '\<features/.*\.feature$'

5 comments on commit d83890f

Contributor

graywh commented on d83890f Sep 29, 2012

Looks like lines 691-696 are redundant after the addition of 697-698.

Owner

tpope replied Sep 30, 2012

I don't think so, as 697-698 assumes the subdirectory is plural. But I should probably tweak them a bit so that I'm consistently using test-model, etc.

Owner

tpope replied Sep 30, 2012

Err, what do the minitest rake tasks look like? rake test:models? There's more fallout from this than I realized.

Contributor

graywh replied Sep 30, 2012

https://github.com/blowmage/minitest-rails/blob/master/lib/minitest/rails/tasks/minitest.rake

minitest:{models,controllers,helpers,mailers,acceptance,[any other directory under test/]}

Owner

tpope replied Sep 30, 2012

To clarify, I'm more interested in what the Rails 4 rake tasks will look like, rather than this stopgap gem. Surely it's going to stick to the test: namespace, right?

I spent about 45 seconds trying to bundle Edge Rails before giving up.

Please sign in to comment.