Skip to content

Instantly share code, notes, and snippets.

@Arkham
Created March 24, 2014 16:50
Show Gist options
  • Save Arkham/9744263 to your computer and use it in GitHub Desktop.
Save Arkham/9744263 to your computer and use it in GitHub Desktop.
Convert old rspec should syntax to new expect syntax
function! ConvertShouldToExpect()
let rspec_conversions = {
\ 'should': 'to',
\ 'should_not': 'not_to',
\ 'should_receive': 'to receive',
\ 'should_not_receive': 'not_to receive',
\ }
for [old, new] in items(rspec_conversions)
execute "normal! " . ':%s/\v^(\s+)(.+)\.' . old . '>/\1expect(\2).' . new . '/ge' . "\<CR>"
endfor
endfunction
nnoremap <Leader>cse :call ConvertShouldToExpect()<CR>
@Favorwilliams
Copy link

My Pleasure to write you,
My name is Favor Williams,
My email address is
( Favor24@live.com)
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,

Favor24@live.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment