Created
November 23, 2011 17:35
-
-
Save cfcosta/1389317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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