example from http://code.tutsplus.com/tutorials/ruby-for-newbies-testing-with-rspec--net-21297, updated for newer versions of Ruby and Rspec