I started watching Gary Bernhardt’s Destroy All Software screencasts recently and after watching a specific episode, I had to have his Ruby testing setup. After sitting in Vim config for a while, with some improvements I made, I started feeling like I should somehow contribute my changes back. After I started adding a few more changes suggested by fellow Taconaut Steven Harman, I decided it really needed to be a Vim Plugin.
Announcing vim-vroom! An easy way to run your Ruby tests without leaving Vim. If you’re hackin’ away at some Ruby code, you can open up your test file and hit r (mapped to :VroomRunTestFile) to have it run that file. Now you can bounce around anywhere in your application code and just be a r away from running your last test file. If your testing framework supports it, you can also use R (mapped to :VroomRunNearestTest) to run the nearest test in the file as well.
Currently, MiniTest/Test::Unit, Cucumber, and RSpec are all supported. I’ve tried to ensure everything is easily customizable for whatever workflow you may have, and whatever preferences you may have. Things such as clearing the screen before running tests, color usage, key mappings, and more, are all optional and can easily be toggled on or off with just 1 line in your Vim config. Everything is documented for easy access in or outside of Vim. There aren’t any known issues at the moment, but if you run into one, please file a GitHub issue, or, if you’re particularly vimscript savvy, fork the project and send me a pull request!