From: Ryan Davis Date: 2010-11-23T17:18:25+09:00 Subject: Re: debugging subprocess On Nov 22, 2010, at 21:19 , Chad Boyd wrote: > Ryan Davis wrote in post #963270: >> On Nov 21, 2010, at 21:06 , Chad Boyd wrote: >> >>> I'm using Autotest to automatically run my tests when I modify my code. >>> I would like to use ruby-debug to debug some of my code. >> >> These two activities are separate (testing vs debugging). Why are you >> trying to debug via autotest? Why not just run your tests directly when >> you need to debug? > > True, they are separate. I guess my answer to that question would be > laziness :) It's easier to just quickly enter a debugger statement, > save off my file and let autotest rerun the test for me than to > open/switch to another terminal window and run the test manually. Not > to mention I would need to either kill the autotest process before > entering my debugger statement, or after debugging, go back to the > autotest window that is now hanging from my debugger statement and > continue it (without seeing the debugging context). I generally debug entirely through my tests, but if I were in your situation it'd look something like this: + normal development with autotest. + get stuck and need to poke internally. + switch to autotest terminal, suspend. + add breakpoint call where needed and save. + switch to autotest terminal, run rake or individual test. + poke until I understand the situation, quit. + remove breakpoint call and write a test to reproduce the problem + switch to autotest terminal and foreground the autotest process. autotest has to read the output of the tests in order to function. It cannot let go of that mid-run.