Skip to content
Browse files

don't require rspec as a filetype and don't set makeprg

  • Loading branch information...
1 parent 3152cf9 commit 139ed401da1d9203b700b78818f0f39f58b511b8 Doug McInnes committed
Showing with 1 addition and 7 deletions.
  1. +1 −7 plugin/ruby_single_test.vim
View
8 plugin/ruby_single_test.vim
@@ -30,7 +30,7 @@ let loaded_ruby_single_test = 1
function! s:Run()
let s:make_cmd = "make" . (exists("g:ruby_single_test_no_bang") ? "" : "!")
- if &filetype == "rspec"
+ if &filetype == "rspec" || &makeprg =~ "spec"
call s:ExecuteRubySpec()
elseif &makeprg =~ "ruby" " Test::Unit
call s:ExecuteRubyUnitTest()
@@ -42,7 +42,6 @@ endfunction
function! s:ExecuteRubyUnitTest()
let s:line_no = search('^\s*def\s*test_', 'bcnW')
if s:line_no
- let s:old_make = &makeprg
exec s:make_cmd . " \"%\" -n \"" . split(getline(s:line_no))[1] . "\""
else
echo "Can't find a test!"
@@ -53,11 +52,6 @@ function! s:ExecuteRubySpec()
exec s:make_cmd . " \"%\" -l " . line(".")
endfunction
-augroup RUBY_SINGLE_TEST
- au!
- au BufNewFile,BufRead *_test.rb let &l:makeprg = "ruby"
-augroup END
-
nmap <unique> <script> <Plug>ExecuteRubyTest <SID>Run
nmap <SID>Run :call <SID>Run()<CR>

0 comments on commit 139ed40

Please sign in to comment.
Something went wrong with that request. Please try again.