Jump between your code and your tests

Friday, February 28th, 2014
By Daniel Cooper

Down in the Homeflow development dungeons we’re super keen on unit tests. We use guard alongside rspec, this allows us to get immediate feedback as to whether any changes to the codebase have broken things.

In my experience, unit testing is easier to do when you remove as much friction from your code-test-code flow as possible. We work on reasonably large projects and I always find that I spend longer than I’d like, looking for the unit tests corresponding to the code I have been working on.

Partly because searching for files is boring and partly because I wanted to check out Github’s new Atom text editor, we’ve built a little plugin that make’s this a bit easier.

If you’re viewing app/services/real_time_feeds/merger.rb and you press ctrl-` you’ll be moved to spec/services/real_time_feeds/merger_spec.rb. Lovely.

Here’s a link to the plugin: https://atom.io/packages/test-jumper. Happy testing.