When writing a script that updates a large amount of data (typically a rake task), it's easy to end up with something like this:
A long, procedural script that works like a black box.
The problem is that testing this properly usually means running the script multiple times against different datasets and checking the final state of the database.
The tests tend to become long setup sections, small variations from one test to another (often involving subtle or unclear changes), and finally an assertion against the final database state using a query that doesn't tell us much about why something happened.