Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Integralist/8115457 to your computer and use it in GitHub Desktop.

Select an option

Save Integralist/8115457 to your computer and use it in GitHub Desktop.
Shortcut Vim mappings for running RSpec and Cucumber tests
" Running Tests...
" See also <https://gist.github.com/8114940>
" 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>
@suchov

suchov commented Apr 24, 2014

Copy link
Copy Markdown

Cool, thanks, man!

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