A ruby solution to Project Euler problem #9, tested with RSpec