O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pry

Once upon a time, I was a big fan of development environments that had big fancy symbolic debuggers that let you set breakpoints and watch variables and step through the code.

What can I say? I was young and programming in Java.

When I started using TDD, I largely stopped using debuggers. Having small, focused tests eliminates most of the need to walk through code in a step debugger. That said, it’s sometimes nice to be able to stop a test in progress and peer inside the Ruby virtual machine to see what’s going on.

Enter Pry.

Pry is technically a Ruby console—a souped-up replacement for irb, but with some add-on gems. It makes an excellent debugger. You can even coax it to reload code changes and rerun specs from inside Pry, which is as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required