Created
July 27, 2011 12:21
-
-
Save slawosz/1109241 to your computer and use it in GitHub Desktop.
Run single rspec spec in vim
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
map <F2> :<C-U>!bundle exec rspec <C-R>=expand("%:p") <CR> --drb -l <C-R>=line("'.") <CR> <CR> | |
map <C-F11> :call RunCurrentTest()<CR> | |
nmap <F11> :call RunLastTest()<CR> | |
nmap <F12> :!rspec <C-R>% --drb<CR> | |
function RunLastTest () | |
if exists('w:current_test') | |
exe '!rspec ' . w:current_test . ' --drb' | |
else | |
call RunCurrentTest() | |
endif | |
endfunction | |
function RunCurrentTest () | |
let w:current_test = expand("%:.") . ':' . line(".") | |
exe '!rspec ' . w:current_test . ' --drb' | |
endfunction |
@lukaszkorecki: I don't use guard, I described my test experience here: http://slawosz.github.com/2011/08/11/how-do-i-test-spork-and-emacs/
Oh cool, I love reading how other people do this kind of thing. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used to have this function - it runs rspec for
and opens a location list for easy navigation.... But then I started using guard :-)