[rspec-users] [cucumber] how to debug cucumber with netbeans?

Jean-Michel Garnier jean-michel at 21croissants.com
Sat May 9 04:40:44 EDT 2009

Jean-Michel Garnier wrote:
> 3 months ago, I submitted a patch to cucumber so I could run cucumber from
> a
> ruby script and use the debugger in netbeans
> (https://rspec.lighthouseapp.com/projects/16211/tickets/128-running-feature-from-ruby-script)
> It worked well at the time but I can't make it work with cucumber 0.3.2.
> Here is the stacktrace:
> Cucumber::Netbeans::Runner.new().run_feature
> "features/_admin/projects.feature"
> I wonder if fellow netbeans on cucumber users will have an idea ...
> Ironically, debugging that script with netbeans crashes the debugger at
> Library/Ruby/Gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54 
> For the time being, I am using the "old school" ruby-debug which works
> pretty well ...
> JM

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.
View this message in context: http://www.nabble.com/-cucumber--how-to-debug-cucumber-with-netbeans--tp23446299p23458483.html
Sent from the rspec-users mailing list archive at Nabble.com.

More information about the rspec-users mailing list