What You’ve Done

In this chapter you looked at tools you can use to diagnose a failing test. You can print values to the console using the Ruby p method or the Awesome Print gem. If you’re having trouble isolating when a breaking change was introduced, you can use git bisect to isolate which change caused the problem. If you think you have a test failure caused by the interaction of multiple specs, rspec bisect or minitest bisect is your friend. If you want to walk through your code step by step, the Pry gem offers a number of tools to help you do exactly that.

Troubleshooting is only one way to improve your test experience. You can also make your test setup better in a more general way, as I’ll discuss in the next chapter.

Footnotes

[72] ...

Get Rails 5 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.