Permalink
Browse files

Use custom test-runner.

  • Loading branch information...
1 parent 5eae2c0 commit c4abdacd4e98f6df79e01437034dfc6dd48fb855 Dean Strelau committed Nov 12, 2011
Showing with 25 additions and 3 deletions.
  1. +22 −0 bin/test-runner
  2. +3 −3 vimrc
View
@@ -0,0 +1,22 @@
+#!/bin/zsh
+set -e
+
+egrep -q 'test_helper|spec_helper' $1
+if [ $? -eq 0 ] ; then # GIVE ME THE RAILS
+ # If we see a running spin server, just push the test file onto it.
+ # otherwise we'll have to boot up bundler from scratch
+ $(ps ax | grep -q '[s]pin serve')
+ if [ $? -eq 0 ] ; then
+ echo ">> spin push $1"
+ spin push $1
+ else
+ echo ">> bundle exec ruby -Ilib -Itest $1"
+ bundle exec ruby -Ilib -Itest $1
+ fi
+else
+ # No Rails necessary. Whoohoo!
+ echo ">> ruby -Ilib -Itest $1"
+ ruby -Ilib -Itest $1
+fi
+
+# vim: noet:ft=sh:ts=4:sw=4:
View
@@ -62,9 +62,9 @@ cnoremap %% <C-R>=expand('%:h').'/'<cr>
function! RunTests(filename)
" Write the file and run tests for the given filename
- :w
- :silent !echo;echo;echo;echo;echo
- exec ":!bundle exec ruby -Itest " . a:filename
+ :wa
+ :silent !echo;echo;echo;echo
+ exec ":!test-runner " . a:filename
endfunction
function! SetTestFile()

0 comments on commit c4abdac

Please sign in to comment.