Spain defeat Peru 3-1 in Puebla as the European champions head into the World Cup on a high without injured star Lamine Yamal.