Introducing ModelMocker
While writing Rails apps, I've written several variants on the 'give me an ActiveRecord instance that can't talk to the DB' theme over the last couple of years while writing tests or specs for an app. The basic pattern is a pretty good one - it guarantees you a certain degree of test isolation for your unit tests or specs, when you need it. And, because you're make specific instances isolated, you can get to the DB if you need to.