Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shortcut Vim mappings for running RSpec and Cucumber tests
" Running Tests...
" See also <>
" Run currently open RSpec test file
map <Leader>rf :w<cr>:!rspec % --format nested<cr>
" Run current RSpec test
" RSpec is clever enough to work out test to run if cursor is on any line within the test
map <Leader>rl :w<cr>:exe "!rspec %" . ":" . line(".")<cr>
" Run all RSpec tests
map <Leader>rt :w<cr>:!rspec --format nested<cr>
" Run currently open cucumber feature file
map <Leader>cf :w<cr>:!cucumber %<cr>
" Run current cucumber scenario
map <Leader>cl :w<cr>:exe "!cucumber %" . ":" . line(".")<cr>
" Run all cucumber feature files
map <Leader>ct :w<cr>:!cucumber<cr>

This comment has been minimized.

Copy link

@suchov suchov commented Apr 24, 2014

Cool, thanks, man!

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