Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created November 18, 2011 23:19
Show Gist options
  • Select an option

  • Save steveklabnik/1378073 to your computer and use it in GitHub Desktop.

Select an option

Save steveklabnik/1378073 to your computer and use it in GitHub Desktop.
RSpec vimrc
" run our spec files
function! RunSpecs()
let spec = matchstr(expand("%:r"), '_spec$')
if empty(spec)
return "spec/".expand("%:r")."_spec.rb"
else
return expand("%")
endif
endfunction
map <leader>t :!rspec <C-R>=RunSpecs()<CR><LF>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment