jeudi 24 septembre 2015

Debugging rails tests

Testing has been the thing I've avoided until I realized that with well written tests I can avoid having to enter console and running a string of commands over and over again. The big issue I'm having, however, is that when a test fails, I can't see much data to use to debug with. For example, when I'm testing models I need to see the models attributes, and I need to control when it's been built, created, and saved, and a way to detect these states. With rails fixtures and plain vanilla tests this is annoying to do.

How can I make debugging fixtures and rails tests easier? Is there a way to display more console-like information when a test fails? Which testing tools can I use to debug more easily? After all, debugging the tests themselves is a huge waste of time, and the biggest obstacle to using them in the first place.

Thanks!

Aucun commentaire:

Enregistrer un commentaire