Ever been caught in a loop while binding.prying through a spec in RSpec? I have to admit I put myself in that situation far too many times before I learned how to get out of it properly. As it turns out it’s really easy to exit a loop in pry… and without shutting down the Rails server.

exit!

If that syntax doesn’t suit your fancy, there are more ways to exit a loop in pry, such as:

!!!

and

exit-program