In Vim run :RSpec
to activate the key mappings. <Leader>t
can either run all tests in the current file or all tests in the project if no file is present. <Leader>T
will run the test on the current line. Run :RSpec!
to deactivate the key mappings.
Last active
December 29, 2015 15:09
-
-
Save hovsater/7688474 to your computer and use it in GitHub Desktop.
User-defined command to setup key mappings for RSpec.
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 RSpecCommands(bang) | |
if !a:bang | |
noremap <Leader>t :!bundle exec rspec %<CR> | |
noremap <Leader>T :!bundle exec rspec %:<C-R>=line('.')<CR><CR> | |
else | |
silent! nunmap <Leader>t | |
silent! nunmap <Leader>T | |
endif | |
endfunction | |
command -bang RSpec call RSpecCommands(<bang>0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment