Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created November 23, 2011 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfcosta/1389317 to your computer and use it in GitHub Desktop.
Save cfcosta/1389317 to your computer and use it in GitHub Desktop.
function! RunSpec()
if executable('./bin/spec')
:!./bin/spec %
elseif executable('./bin/rspec')
:!./bin/rspec %
elseif executable('bundle')
:!bundle exec ruby -I'lib:test' %
endif
endfunction
function! RunSpecs()
if isdirectory('test')
:!./bin/rake test
elseif isdirectory('spec')
:!./bin/rake spec
else
echo "No test directory found."
end
endfunction
nmap ,r :w<cr> :call RunSpecs()<cr>
nmap ,s :w<cr> :call RunSpec()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment