basically to debug a ruby script we use: ruby -rspecs -rdebug file.rb which would debug ruby script line by line. Is there any such debuging feauture in cucumber. -- Posted via http://www.ruby-forum.com/.
Anil Gollaa wrote:> basically to debug a ruby script we use: > ruby -rspecs -rdebug file.rb > which would debug ruby script line by line. > > Is there any such debuging feauture in cucumber. >I just require ''ruby-debug'' and set a debugger statement where I want to stop it. When you run cucumber it will pop into rdg where you set the breakpoint. If that doesn''t make sense, this post has more detail: http://technicalpickles.com/posts/debugging-cucumber -Ben
hi, Thanks for the information, When i run cucumber testfile.feature, I was able to halt execution at breakpoint, but when i type ''n''. it is getting in to /lib/cucumber/ast/step_invocation.rb:33 and some other lib files of cucumber. I just want to debug line by line of the script, instead of getting in to cucumber files. please help me in this regard -- Posted via http://www.ruby-forum.com/.
Anil Gollaa wrote:> hi, > Thanks for the information, > When i run cucumber testfile.feature, I was able to halt execution at > breakpoint, but when i type ''n''. it is getting in to > /lib/cucumber/ast/step_invocation.rb:33 and some other lib files of > cucumber. > > I just want to debug line by line of the script, instead of getting in > to cucumber files. > > please help me in this regard >Sorry, but I don''t know of anything that will automatically allow you to skip over framework code.. Although, that would be very cool. My best suggestion would be to set multiple breakpoints and hit "c" to continue to the next one so you can skip through all of Cucumber''s code. -Ben
On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> wrote:> Anil Gollaa wrote: >> >> hi, >> Thanks for the information, >> When i run cucumber testfile.feature, I was able to halt execution at >> breakpoint, but when i type ''n''. it is getting in to >> /lib/cucumber/ast/step_invocation.rb:33 and some other lib files of >> cucumber. >> >> I just want to debug line by line of the script, instead of getting in to >> cucumber files. >> >> please help me in this regard >> > > Sorry, but I don''t know of anything that will automatically allow you to > skip over framework code.. Although, that would be very cool. ?My best > suggestion would be to set multiple breakpoints and hit "c" to continue to > the next one so you can skip through all of Cucumber''s code. >I will sometimes set a global variable to help me flag when to debug, if the code in question gets executed multiple times. e.g. $c = true if my_condition_is_met And then... debugger if $c> -Ben > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
On 07/04/2009, Zach Dennis <zach.dennis at gmail.com> wrote:> On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> wrote:> > My best > > suggestion would be to set multiple breakpoints and hit "c" to continue to > > the next one so you can skip through all of Cucumber''s code.> I will sometimes set a global variable to help me flag when to debug, > if the code in question gets executed multiple times. e.g. > > $c = true if my_condition_is_met > > And then... > > debugger if $cSome useful tips, but I feel the ruby-debug tutorials that exist are lacking. Would it be fitting for me to add a Cucumber and ruby-debug page on the Wiki? Aidy
On Tue, Apr 7, 2009 at 4:30 PM, aidy lewis <aidy.lewis at googlemail.com>wrote:> On 07/04/2009, Zach Dennis <zach.dennis at gmail.com> wrote: > > On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> wrote: > > > > My best > > > suggestion would be to set multiple breakpoints and hit "c" to > continue to > > > the next one so you can skip through all of Cucumber''s code. > > > I will sometimes set a global variable to help me flag when to debug, > > if the code in question gets executed multiple times. e.g. > > > > $c = true if my_condition_is_met > > > > And then... > > > > debugger if $c > > Some useful tips, but I feel the ruby-debug tutorials that exist are > lacking. Would it be fitting for me to add a Cucumber and ruby-debug > page on the Wiki? >A page titled ruby-debug would be great Aidy! Aslak> > Aidy > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090407/64e04b69/attachment.html>
On Apr 7, 2009, at 8:30 AM, aidy lewis wrote:> On 07/04/2009, Zach Dennis <zach.dennis at gmail.com> wrote: >> On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> wrote: > >>> My best >>> suggestion would be to set multiple breakpoints and hit "c" to >>> continue to >>> the next one so you can skip through all of Cucumber''s code. > >> I will sometimes set a global variable to help me flag when to debug, >> if the code in question gets executed multiple times. e.g. >> >> $c = true if my_condition_is_met >> >> And then... >> >> debugger if $c > > Some useful tips, but I feel the ruby-debug tutorials that exist are > lacking. Would it be fitting for me to add a Cucumber and ruby-debug > page on the Wiki? > > AidyThat would be great! Thanks for offering. -Ben
On Tue, Apr 7, 2009 at 7:30 AM, aidy lewis <aidy.lewis at googlemail.com> wrote:> > Some useful tips, but I feel the ruby-debug tutorials that exist are > lacking. Would it be fitting for me to add a Cucumber and ruby-debug > page on the Wiki?With webrat, the following is pretty useful: When /^I view the response$/ do save_and_open_page end
On Apr 7, 2009, at 11:54 AM, Ben Mabey wrote:> > On Apr 7, 2009, at 8:30 AM, aidy lewis wrote: > >> On 07/04/2009, Zach Dennis <zach.dennis at gmail.com> wrote: >>> On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> wrote: >> >>>> My best >>>> suggestion would be to set multiple breakpoints and hit "c" to >>>> continue to >>>> the next one so you can skip through all of Cucumber''s code. >> >>> I will sometimes set a global variable to help me flag when to >>> debug, >>> if the code in question gets executed multiple times. e.g. >>> >>> $c = true if my_condition_is_met >>> >>> And then... >>> >>> debugger if $c >> >> Some useful tips, but I feel the ruby-debug tutorials that exist are >> lacking. Would it be fitting for me to add a Cucumber and ruby-debug >> page on the Wiki? >> >> Aidy > > > That would be great! Thanks for offering.I''ve been meaning to do a ruby-debug screencast for quite some time. Although it won''t be specific to cucumber, I''ll post it on the wiki when I get around to it. Scott> > > -Ben > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 7 Apr 2009, at 17:23, Scott Taylor wrote:> > On Apr 7, 2009, at 11:54 AM, Ben Mabey wrote: > >> >> On Apr 7, 2009, at 8:30 AM, aidy lewis wrote: >> >>> On 07/04/2009, Zach Dennis <zach.dennis at gmail.com> wrote: >>>> On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey <ben at benmabey.com> >>>> wrote: >>> >>>>> My best >>>>> suggestion would be to set multiple breakpoints and hit "c" to >>>>> continue to >>>>> the next one so you can skip through all of Cucumber''s code. >>> >>>> I will sometimes set a global variable to help me flag when to >>>> debug, >>>> if the code in question gets executed multiple times. e.g. >>>> >>>> $c = true if my_condition_is_met >>>> >>>> And then... >>>> >>>> debugger if $c >>> >>> Some useful tips, but I feel the ruby-debug tutorials that exist are >>> lacking. Would it be fitting for me to add a Cucumber and ruby-debug >>> page on the Wiki? >>> >>> Aidy >> >> >> That would be great! Thanks for offering. > > I''ve been meaning to do a ruby-debug screencast for quite some time. > > Although it won''t be specific to cucumber, I''ll post it on the wiki > when I get around to it. > > ScottThis is really good. It''s short and sweet, and makes you realise there''s really not much to it at all: http://railscasts.com/episodes/54-debugging-with-ruby-debug Matt Wynne http://blog.mattwynne.net http://www.songkick.com