Created
August 27, 2009 17:37
-
-
Save samg/176430 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
" Execute open rspec buffer | |
" Thanks to Ian Smith-Heisters | |
function! RunSpec(args) | |
if exists("b:rails_root") && filereadable(b:rails_root . "/script/spec") | |
let spec = b:rails_root . "/script/spec" | |
else | |
let spec = "spec" | |
end | |
let cmd = ":! " . spec . " % -cfn " . a:args | |
execute cmd | |
endfunction | |
" Mappings | |
" run one rspec example or describe block based on cursor position | |
map !s :call RunSpec("-l " . <C-r>=line('.')<CR>) | |
" run full rspec file | |
map !S :call RunSpec("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment