added problem 7 solution with rspec test