This week in Rails – 09/06 to 13/06
It seems that testing has been on the flavour of the week, which is apt really as I myself have been playing with RSpec a lot lately (Blog post forthcoming, once I finish up one of the projects that has been using said testing framework).
Simon Harris from My hovercraft is full of eels describes a simple way to break up you tests into DRY, manageable chunks: http://www.redhillconsulting.com.au/blogs/simon/archives/000429.html
Ben Mabey shows you how to use Macros in RSpec, using Shouda. Macros are as old as the hills, but can be really handy to organise many tasks simply: http://www.benmabey.com/2008/06/08/writing-macros-in-rspec/
Michael Ivey reminds us why we should use tests. Not only are they a nice support net, but they encourage us to write better code. It’s like extreme programming without the other programmer: http://gweezlebur.com/2008/6/13/tests-make-you-write-better-code
Outside of the testing arena, a new version of Capistrano — possibly the coolest tool for Ruby — has been released. If you haven’t had a play with Capistrano yet, go and install it and try it out.
And finally for this week, if you have ever been perplexed about whether pieces of code belong in the Model, View or Controller, Starjuice has an article that may give you a clue or two, so you can ensure you code is separated properly: http://starjuice.net/2008/6/model-view-or-controller