Added rspec pending to xit feature. Use: ,rxit
This commit is contained in:
parent
30725b537e
commit
0f166499e9
22
vim/plugin/settings/rspec_pending_to_xit.vim
Normal file
22
vim/plugin/settings/rspec_pending_to_xit.vim
Normal file
@ -0,0 +1,22 @@
|
||||
" Does not work on pending 'blocks', only single lines
|
||||
"
|
||||
" Given:
|
||||
" it "foo bar" do
|
||||
" pending("bla bla"
|
||||
"
|
||||
" Produce:
|
||||
" xit "foo bar" do
|
||||
"
|
||||
function! ChangePendingRspecToXit()
|
||||
" Find the next occurrence of pending
|
||||
while(search("pending(") > 0)
|
||||
" Delete it
|
||||
normal dd
|
||||
" Search backwards to the it block
|
||||
?it\s
|
||||
" add an 'x' to the 'it' to make it 'xit'
|
||||
normal ix
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
map <silent> ,rxit :call ChangePendingRspecToXit()<cr>
|
Loading…
x
Reference in New Issue
Block a user