[rspec-users] [cucumber] how to debug cucumber with netbeans?
ben at benmabey.com
Sat May 9 15:29:10 EDT 2009
Jean-Michel Garnier wrote:
> Jean-Michel Garnier wrote:
>> 3 months ago, I submitted a patch to cucumber so I could run cucumber from
>> ruby script and use the debugger in netbeans
>> It worked well at the time but I can't make it work with cucumber 0.3.2.
>> Here is the stacktrace:
>> I wonder if fellow netbeans on cucumber users will have an idea ...
>> Ironically, debugging that script with netbeans crashes the debugger at
>> For the time being, I am using the "old school" ruby-debug which works
>> pretty well ...
> Thanks for your answer, Ben
>> So, you can run the feature fine without the debugger?
> * yes, it run fine indeed, I mean it loads everything all right and then
> crash in a cucumber step with "segmentation fault"
>> What is
>> confusing is that "lib/active_merchant" is showing up in the backtrace
>> saying it can't be found...
> * I don' understand it either and I suspect it's a Rails / cucumber /
> polyglot rubygems issue as I have found a few messages describing problems
> with cucumber and "polyglot_original_require'
> from /Library/Ruby/Gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54"
> * For the time being, I just give up debugging cucumber with netbeans ...
>> What if you try to run the feature with the
>> debugger from outside of Netbeans?
> * You mean with classic ruby-debug? I had never used it before as I come
> from a java + Eclispe background and always used an IDE to debug.
> I must admit that ruby-debug is very easy to use and it did well to find the
> cause of my problem:
> cucumber calling webrat visit with "eval". There was a bug in a
> before_filter of a controller which was doing an infinite loop. Apparently,
> the mac ruby interpreter did not like it and crashed with "segmentation
> fault". Running Rails in "development" mode was working fine and showing an
> exception stacktrace...
> This is the kind of situtation where TDD is actually slower than
> "prehistoric development with no tests". I spent 3 hours looking for the
> source of the problems and it took me 15 minutes running Rails in
> developement mode.
> In order to improve webrat, I'll spend 1 hour this morning o try to write a
> spec to reproduce the bug.
Glad you got it fixed. Yeah, TDD/BDD certainly can slow you down at
times especially on initial investments like this. It just comes down
to if it is worth it for you and this project or if you would be fine
with some technical debt. :)
More information about the rspec-users