Aliasing dangerous methods in your tests
Lately we’ve been aliasing dangerous methods in our tests to make sure we don’t accidentally break something. It’s not very nice when tests delete your favorite episode of Sesame Street or add a MySQL user, so we had a lot of snippets like this laying around:
We refactored it and now we specify the same thing like this:
The code is currently included in on_test_spec, our plugin for writing Rails specs on test/spec.