I asked myself this question today while debugging a test. How the
heck do I connect to a breakpointer session from a unit test?
Stephen''s suggestion is a good workaround (type successive lines), but
I haven''t heard anyone address the question: how do you get a REAL
Ruby debugging session going in a Rails test! Breakpoint during a
test drops you into an IRB session -- not a DRB debugger session!!!
The breakpointer session just sits there.
Don''t get me wrong, I''ve been finding IRB incredibly useful in
my unit
tests when I can''t figure out a failure just by looking at the code,
but the question remains, how to debug?
I agree that the documentation on Rails debugging is *dodgy*.
Obie Fernandez
> ---------- Forwarded message ----------
> From: Stephen Caudill
<scaudill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> Date: Tue, 27 Sep 2005 13:28:54 -0400
> Subject: Re: [Rails] debugging: how?
> On 9/27/05, Leonardo Francalanci
<Leonardo.Francalanci-C8ozdTPzUPZl57MIdRCFDg@public.gmane.org> wrote:
>
> > But: what if I want to see the stack? What if I want to step ahead? In
> > other words: are there some docs about it????
>
> The docs I''ve come across have been a bit dodgy. But,
here''s what''s
> worked for me:
>
> I tend to use the breakpointer script by setting a breakpoint at the
> beginning of a problem method and issuing each successive line of code
> individually at the irb prompt. This gives you instant feedback when
> a line succeeds or fails and if it fails, the chance to revise and
> reissue the syntax while keeping the context of the previous
> successful commands.
>
> HTH,
> Stephen Caudill
>