On Wed, Oct 7, 2009 at 11:33 AM, Marnen Laibow-Koser
<[email protected]> wrote:
> Patrick Doyle wrote:
>> Are there good tips and resources for debugging unit tests?
>
> Just call the debugger from within your app code, or from the test
> itself.  When the "debug" statement is executed, you'll be in an
> interactive debugger.  Simple.
>

I'm missing something because it is not simple...

class LotTest < ActiveSupport::TestCase
...
  test "add lot to assembly" do
    debug
   ...
  end
end

When I try running this as:

$ ruby -I test test/unit/lot_test.rb -n test_add_lot_to_assembly

the test fails with:

NameError: undefined local variable or method `debug' for ...

When I try running this as:

$ rdebug -I test test/unit/lot_test.rb -n test_add_lot_to_assembly
(rdb:1) c

The test runs to completion and doesn't stop at my #debug statement.

I won't even go into my trials and tribulations trying to get this to
run under emacs...

I agree though, this should really be simple.  Having said that, I
must be missing something terribly obvious.

--wpd

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to