resources: rename .each to .each_in_batches

This is to avoid surprising users.

This patch also fixes an issue with the spec tests.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>