Today I Learned

hashrocket A Hashrocket project

Choose Your Own RSpec Command

We use vim-turbux to quickly iterate on Ruby tests. But we hit an issue setting up a project on Ubuntu 14.014 that had not been developed in a Linux environment before— Webkit tests there require the Xvfb library. Leaving out the xvfb-run wrapper raises a connection error in test.

Luckily, you can customize vim-turbux commands for each test framework.

Add this to your ~/.vimrc.local:

" ~/.vimrc.local
let g:turbux_command_rspec  = 'xvfb-run -a rspec'

Any RSpec test sent to the terminal window now includes the wrapper library.

Documentation

h/t Dorian Karter, Chris Erin, and Josh Davey

See More #vim TILs
Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.