An excellent refactor provided by @tokland

Original SO post here: http://codereview.stackexchange.com/questions/72161/dry-ing-up-some-rspec/72168#72168