Ruby Unit Test Visibility via Xmonad

VIM is my editor of choice for working on Ruby projects; however, as it's not technically a full IDE there is no official built in way to run unit tests. I've used a variety of vimscripts and automation tools (autotest, guard, watchr) to get tests running more or less in the background and out of the way. The question then is where to put the test window or notifications. The solution that I came up with that I like best is to use xmonad to split my windows. I like the accordion layout for this purpose.

The top window contains VIM with tabs, windows, sessions, etc... The bottom window is for rspec unit tests. I swap the window size and focus with super+j or flip positions with shift+super+j. By doing this I'm able to see the status of my tests and optionally the details of those tests at a glance.

A full xmonad configuration is out of scope for this post; however, getting an accordion layout configured for a workspace is really simple. If you're interested in another more detailed configuration article please get in touch with me via the contact form on this site or through a comment.

 1 import XMonad.Layout.Accordion
 2 
 3 myLayout = avoidStruts $
 4     onWorkspace "dev" (tiled ||| Accordion) $
 5     --- other details omitted
 6   where
 7     tiled   = Tall nmaster delta ratio
 8     nmaster = 1
 9     ratio   = 1/2
10     delta   = 3/100

Xmonad Accordion Layout

comments powered by Disqus