Live data from Hacker News

Using pry in production

bugsnag.com

11–16 of 16 posts

Re: Using pry in production

#12
post #8

That's pretty cool. What I'd really like to know, though, is if anybody knows how to drop into a pry-debugger debug session during a unit test.

You can use https://github.com/ConradIrwin/pry-rescue#rspec pry-rescues rspec integration to automatically fall into pry when a test fails

Re: Using pry in production

#13
post #8

That's pretty cool. What I'd really like to know, though, is if anybody knows how to drop into a pry-debugger debug session during a unit test.

I built a small testing framework with a pry workflow as one of it's goals. It's possible to run the tests in pry mode which drops you into a pry session on test failure. I've used it on several small libs & the test+pry workflow is quite nice. https://github.com/hopsoft/micro_test

Re: Using pry in production

#14
post #8

That's pretty cool. What I'd really like to know, though, is if anybody knows how to drop into a pry-debugger debug session during a unit test.

Just binding.pry works for me in rspec. Does that not work for you?

That's what I was going to recommend. I use "binding.pry" in my specs frequently. Just be sure to take it out before you commit ;)

Re: Using pry in production

#15
post #8

That's pretty cool. What I'd really like to know, though, is if anybody knows how to drop into a pry-debugger debug session during a unit test.

Just binding.pry works for me in rspec. Does that not work for you?

Thanks, I'll give it a try, though I'm using Minitest. I haven't really tried much yet on that front; I mostly just got to the point of realizing that this issue I'm working on now is really going to be a pain to get figured out without a debugger.

For this project, I just switched, like a month or so ago, to an all-Vim workflow. I mostly feel more productive in it so far, but a real debugger is the one thing that I had been putting off figuring out.

Post reply on HN