Rewriting the inject method in Ruby, using Rspec