Code from Andrew Burgess's Rspec tutorial.