Original post can be found at http://seesparkbox.com/foundry/code_retreat_roundup_github_toolbox
Last Saturday, Rob and I went down to Cincinnati for the Global Day of Code Retreat. We spent the entire day practicing code. Yes, that’s right – practicing. We wrote and tested code for 45 minutes, talked about what we had done, deleted our code, and then started over. It was a very useful exercise which Rob will be blogging about very soon.
Since Rob is going to write about how incredibly beneficial the day was for us, I wanted to highlight some of the cool tools that I discovered while I was there. The day was centered around developing using TDD, so there’s definitely a testing slant to my list. Now, I’ll be the first to say that I definitely fall into the camp of wanting to write tests for my code; but not having done it on a project, I wasn’t sure where to start. After the Code Retreat, I feel much more confident in my ability to write good tests, and I think that these tools will help me to do just that.
I had the opportunity to pair with @pkananen on some Ruby, using RSpec for testing. As I was trying to figure out how to start writing the tests, Peter suggested we try given. It’s basically a simple syntax for quickly writing very clear, readable tests.
The first RSpec test I wrote looked something like this:
This is an interpretation of this same test using given:
I haven’t played with these a lot, but I feel like the rspec-given tests may be more expressive than the straight RSpec tests. It provides a simple syntax that I think most people could read and understand what the test results should be.
During another session, I paired with @MattBrewer and saw another really cool tool – Guard. During my first two sessions, the process was something like this:
Working with Matt, however, that workflow changed:
Step 4 here was the frosting on the cake. Every time we saved a file, Guard ran the tests. With a terminal window open off to the side, we could instantly see the results of the tests. Seeing as we only had 45 minutes to get as much of the problem solved as we could, this was a very useful thing to have running.
Setting up Guard was pretty easy, and I found that it will also do things such as rebuilding your gem set if you update your gemfile. I also installed a growl gem, so I now get test/gemfile build results in growl notifications. I’m sure it does a lot more, and I’m anxious to spend more time finding out what it can do.
While I was setting up Guard (with a few pointers from @cromwellryan), Ryan told me about this little app. Between running multiple Rails apps and other miscellaneous things, it’s not uncommon for me to have Terminal running with multiple tabs open for each project I'm working on. Consular provides a way to define sets of windows/tabs and provides a way to execute commands in those windows/tabs at start up. So, I’m setting up consular files to open up work spaces for my projects and launch the server and any other appropriate files for those projects. AWESOME!
I wrote a quick little consular script for starting up my Rails projects:
Today, there are so many tools to help us build things faster and more efficiently that it is sometimes hard to keep up with them. Frankly, these tools solved some problems that I didn’t even really know that I had. I am getting the feeling that after using these for a little while some of them will quickly become essential parts of my development toolbox.
I would love to know of other cool things I can add to my toolbox. Leave me some comments below or on Twitter.
And if you haven't checked out GitHub's Octodex, you should. The Octocat is waiting.