Permalink
Browse files

Add clojure test-running

  • Loading branch information...
1 parent 2babfe3 commit e0fb1a5fcb92ffdaa5494595c79743aebbf42d90 @lmarburger committed Jun 22, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 vimrc
View
11 vimrc
@@ -197,13 +197,16 @@ function! RunTestFile()
let in_spec_file = match(expand("%"), '_spec.rb$') != -1
let in_test_file = match(expand("%"), '_test.rb$') != -1
let in_feature_file = match(expand("%"), '.feature$') != -1
+ let in_clj_file = match(expand("%"), '.clj$') != -1
if in_spec_file
call SetTestFile()
elseif in_test_file
call SetTestFile()
elseif in_feature_file
call SetTestFile()
+ elseif in_clj_file
+ call SetTestFile()
elseif !exists("g:grb_test_file")
return
end
@@ -223,13 +226,16 @@ function! ChooseTestRunner(filename)
let run_specs = match(a:filename, '_spec.rb$') != -1
let run_tests = match(a:filename, '_test.rb$') != -1
let run_feature = match(a:filename, '.feature$') != -1
+ let run_clj = match(a:filename, '.clj$') != -1
if run_specs
call RunSpecs(a:filename)
elseif run_tests
call RunTests(a:filename)
elseif run_feature
call RunFeature(a:filename)
+ elseif run_clj
+ call RunLein(a:filename)
endif
endfunction
@@ -251,5 +257,10 @@ function! RunFeature(filename)
exec ":!time bundle exec cucumber -r features " . a:filename
endfunction
+function! RunLein(filename)
+ silent exec ":!echo lein test"
+ exec ":!time lein test"
+endfunction
+
nmap <leader>. :call RunTestFile()<CR>
nmap <leader>> :silent :!clear<cr>:w<cr>:!ruby -Ilib %<cr>

0 comments on commit e0fb1a5

Please sign in to comment.