On Tue, Sep 16, 2008 at 10:00 AM, Martin Streicher <
[EMAIL PROTECTED]> 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, 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.

///ark
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to