[rspec-users] Prepare for newbie-ness

David Chelimsky dchelimsky at gmail.com
Tue Sep 16 15:05:14 EDT 2008

On Tue, Sep 16, 2008 at 1:59 PM, Mark Wilden <mark at mwilden.com> wrote:
> On Tue, Sep 16, 2008 at 10:00 AM, Martin Streicher
> <martin.streicher at gmail.com> wrote:
>> 3/ Has any documented how to run the debugger via rspec to help track down
>> errors?
> We TDD/BDD/Agile practitioners aren't supposed to use a debugger,

Please pay no attention to that sort of bullshit :)

The idea is that TDD, practiced with discipline, should make you
depend less on a debugger. This is a good thing since debugging time
is impossible to estimate. But the idea that you're not supposed to
use a debugger is religious hog-wash.

> so don't
> tell anyone I said this. But all I have to do (on a Mac system) is to
> install the ruby-debug gem, then insert
>  require 'ruby-debug'
>  debugger
> at the point in my code where I want to break into the debugger. Then
> running the specs via most any means (including autotest, but not
> spec_server) will start up the debugger at that point. Frankly, though, I'll
> often just stick in some p statements to show some data. Actually, I use
> this little function:
>   def l &block
>     name = block.call
>     puts name + ' = ' + eval(name, block).inspect
>   end
> which, when called like 'l{'foo'}' prints 'foo = ' followed by the value of
> foo.
> But these are pretty brute-force techniques, so we'll just keep it our
> little secret.

OK - we won't tell anyone.

Thanks for sharing!


> ///ark
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list