.vimrc foo: Convert to "expect"

Updating tests to the new Rspec syntax can be a pain. Here is a quick snipped to drop into your .vimrc to ease your pain:

" Example:
" response.body.should have_content("something")
" expect(response.body).to have_content("something")

" =================================================
" Macro that converts rspec "should"s to "expect"s
" =================================================
function! ConvertToExpect()
  :normal! dd
  :normal! P
  :.s/^\(\s\+\)\(.\+\)\.should\(.*\)$/\1expect(\2).to\3/
  :normal ==
endfunction

:command! ConvertToExpect :call ConvertToExpect()
:map <leader>e :ConvertToExpect<cr>