Skip to content

Commit 0ff2351

Browse files
committed
Integrate spec alternates into projections
1 parent e6d2536 commit 0ff2351

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

autoload/rails.vim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,10 +3360,6 @@ function! s:readable_alternate_candidates(...) dict abort
33603360
return ['db/schema.rb', 'db/structure.sql', 'db/'.s:environment().'_structure.sql']
33613361
elseif self.type_name('spec-view')
33623362
return [s:sub(s:sub(f,'<spec/','app/'),'_spec\.rb$','')]
3363-
elseif self.type_name('spec-lib')
3364-
return [s:sub(s:sub(f,'<spec/',''),'_spec\.rb$','.rb')]
3365-
elseif self.type_name('spec')
3366-
return [s:sub(s:sub(f,'<spec/','app/'),'_spec\.rb$','.rb')]
33673363
else
33683364
return self.test_file_candidates()
33693365
endif
@@ -4545,6 +4541,8 @@ let s:has_projections = {
45454541
\ "features/support/env.rb": {"type": "integration test"}
45464542
\ },
45474543
\ "spec": {
4544+
\ "spec/*_spec.rb": {"alternate": "app/{}.rb"},
4545+
\ "spec/lib/*_spec.rb": {"alternate": "lib/{}.rb"},
45484546
\ "spec/controllers/*_spec.rb": {
45494547
\ "template": [
45504548
\ "require 'spec_helper'",

0 commit comments

Comments
 (0)