Created
March 24, 2014 16:50
-
-
Save Arkham/9744263 to your computer and use it in GitHub Desktop.
Convert old rspec should syntax to new expect syntax
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
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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My Pleasure to write you,
My name is Favor Williams,
My email address is
( [email protected])
Am interested to know
more about you,
Contact me for my
photo and other
important issue via,
[email protected]