David Kahn
2010-Sep-13 17:17 UTC
ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
Anyone know how to get ruby-debug (ruby-debug19) to invoke when running my specs? When I place ''debugger'' in my controller and run the spec, it just skips over it. I have require ''ruby-debug'' in spec_helper.rb Rails 3, ruby 1.9.2, ruby-debug19, rspec 2.0.0.beta.22 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2010-Sep-13 17:22 UTC
Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
Ok, now I found if I add *require ''ruby-debug''* in the spec itself the debugger invokes. However.... It is useless. I get a breakpoint in my controller but have no access to anything I want: ../Users/DK/Documents/ror/projects/wavelineup3/app/controllers/user_sessions_controller.rb:14 respond_to do |format| (rdb:1) @user_session *** Unknown command: "@user_session". Try "help". (rdb:1) self *** Unknown command: "self". Try "help". (rdb:1) params *** Unknown command: "params". Try "help". (rdb:1) So, how does one go about debugging their tests, or rather specs, in rspec? On Mon, Sep 13, 2010 at 5:17 PM, David Kahn <dk-rfEMNHKVqOwNic7Bib+Ti1W1rNmOCjRP@public.gmane.org>wrote:> Anyone know how to get ruby-debug (ruby-debug19) to invoke when running my > specs? When I place ''debugger'' in my controller and run the spec, it just > skips over it. > > I have require ''ruby-debug'' in spec_helper.rb > > Rails 3, ruby 1.9.2, ruby-debug19, rspec 2.0.0.beta.22 > > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Sep-13 17:49 UTC
Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
David Kahn wrote:> Ok, now I found if I add *require ''ruby-debug''* in the spec itself > the > debugger invokes. However.... > > It is useless. I get a breakpoint in my controller but have no access to > anything I want: > > ../Users/DK/Documents/ror/projects/wavelineup3/app/controllers/user_sessions_controller.rb:14 > respond_to do |format| > (rdb:1) @user_session > *** Unknown command: "@user_session". Try "help". > (rdb:1) self > *** Unknown command: "self". Try "help". > (rdb:1) params > *** Unknown command: "params". Try "help". > (rdb:1)Perhaps auto-eval is turned off in the debugger. Try typing "p @user_session" instead of "@user_session". And why are you using RSpec specs for your controllers, anyway? Cucumber stories are better for that. RSpec is better for model logic.> > > So, how does one go about debugging their tests, or rather specs, in > rspec?Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2010-Sep-13 18:07 UTC
Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
> > > Perhaps auto-eval is turned off in the debugger. Try typing "p > @user_session" instead of "@user_session". >Thanks -- worked perfectly.> > And why are you using RSpec specs for your controllers, anyway? > Cucumber stories are better for that. RSpec is better for model logic. > >Well, I was hoping to cap new things on this project with Rails 3, ruby 1.9.2, rspec, factory girl..... is getting cucumber up and running is pretty incidental?> > > > > > So, how does one go about debugging their tests, or rather specs, in > > rspec? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Sep-14 12:49 UTC
Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
David Kahn wrote: [...]>> >> And why are you using RSpec specs for your controllers, anyway? >> Cucumber stories are better for that. RSpec is better for model logic. >> >> > Well, I was hoping to cap new things on this project with Rails 3, ruby > 1.9.2, rspec, factory girl.....Uh, what? If you need a tool, use it. Don''t impose silly limits on the number of new things in a project.> is getting cucumber up and running is > pretty > incidental?If by "incidental" you mean "easy", then generally yes. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2010-Sep-14 16:29 UTC
Re: Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
Thanks Marnen, I did take your prod and got Cucumber working.... it was a great day, I think cucumber may even be a bigger win for me than rspec in terms of productivity. On Tue, Sep 14, 2010 at 7:49 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> David Kahn wrote: > [...] > >> > >> And why are you using RSpec specs for your controllers, anyway? > >> Cucumber stories are better for that. RSpec is better for model logic. > >> > >> > > Well, I was hoping to cap new things on this project with Rails 3, ruby > > 1.9.2, rspec, factory girl..... > > Uh, what? If you need a tool, use it. Don''t impose silly limits on the > number of new things in a project. > > > is getting cucumber up and running is > > pretty > > incidental? > > If by "incidental" you mean "easy", then generally yes. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
attila.gyorffy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2010-Oct-10 18:17 UTC
Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
i am having some issues around ruby-debug and rspec for rails3 so i was doing a google search for a solution and came across this thread. i''m sorry I couldn''t miss your thoughts on rppec vs cucumber and don''t wanna play smarty pants here, i just think you cannot replace rppec with cucumber because they are different tools really for different purposes. i am also using cucumber for testing my projects'' integrity - hence cucumber is for integration testing! - but also not lazy to write specs for my controller tests. i found that writing unit tests with rspec helps a lot while your project codebase grows and allows you to identify failing scenarios much easier. i am also trying to be as explicit in my tests as i can, covering edge cases etc. i would not use rspec with integrated views - never been a big fan of that - but would definitely keep writing unit tests with rspec2 and cover integration testing with cucumber. -- Attila On Sep 13, 6:49 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> David Kahn wrote: > > Ok, now I found if I add *require ''ruby-debug''* in the spec itself > > the > > debugger invokes. However.... > > > It is useless. I get a breakpoint in my controller but have no access to > > anything I want: > > > ../Users/DK/Documents/ror/projects/wavelineup3/app/controllers/user_session s_controller.rb:14 > > respond_to do |format| > > (rdb:1) @user_session > > *** Unknown command: "@user_session". Try "help". > > (rdb:1) self > > *** Unknown command: "self". Try "help". > > (rdb:1) params > > *** Unknown command: "params". Try "help". > > (rdb:1) > > Perhaps auto-eval is turned off in the debugger. Try typing "p > @user_session" instead of "@user_session". > > And why are you using RSpec specs for your controllers, anyway? > Cucumber stories are better for that. RSpec is better for model logic. > > > > > So, how does one go about debugging their tests, or rather specs, in > > rspec? > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2010-Oct-10 18:26 UTC
Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
On Sun, Oct 10, 2010 at 1:17 PM, attila.gyorffy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org < attila.gyorffy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i am having some issues around ruby-debug and rspec for rails3 so i > was doing a google search for a solution and came across this thread. > i''m sorry I couldn''t miss your thoughts on rppec vs cucumber and don''t > wanna play smarty pants here, i just think you cannot replace rppec > with cucumber because they are different tools really for different > purposes. >I am new to both rspec and cucumber and still feeling my way. But at least for my current app what I am finding is that by starting with Cucumber, I cover the user experience pretty well, then just write specs as I write models, etc. But the confidence I have in my app is higher and also I am seeing (so far) that my focus is better. Maybe in a few weeks I can let you know but I am finding that if I have good cucumber coverage I feel less compulsive about the lower level test coverage and save time and effort on this. Of course, if I am writing a safety critical or highly sensitive component of course I would throw all the lower level stuff at it too. Just some thoughts from where I am currently.> > i am also using cucumber for testing my projects'' integrity - hence > cucumber is for integration testing! - but also not lazy to write > specs for my controller tests. i found that writing unit tests with >I did for a bit write controller specs but they got overwhelming and I decided based on the 80/20 principle to just trust my cucumber results. Maybe I am wrong... time will tell :) But I don''t disagree with your point, I think it probably goes back to what it is you want to test. I actually changed my method of handling roles so that I could test the class using rspec on the model, that made me feel that although I could perhaps find some problems writing controller specs, it would be diminishing returns.> rspec helps a lot while your project codebase grows and allows you to > identify failing scenarios much easier. i am also trying to be as > explicit in my tests as i can, covering edge cases etc. > > i would not use rspec with integrated views - never been a big fan of > that - but would definitely keep writing unit tests with rspec2 and > cover integration testing with cucumber. > > -- Attila > > On Sep 13, 6:49 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > David Kahn wrote: > > > Ok, now I found if I add *require ''ruby-debug''* in the spec itself > > > the > > > debugger invokes. However.... > > > > > It is useless. I get a breakpoint in my controller but have no access > to > > > anything I want: > > > > > > ../Users/DK/Documents/ror/projects/wavelineup3/app/controllers/user_session > s_controller.rb:14 > > > respond_to do |format| > > > (rdb:1) @user_session > > > *** Unknown command: "@user_session". Try "help". > > > (rdb:1) self > > > *** Unknown command: "self". Try "help". > > > (rdb:1) params > > > *** Unknown command: "params". Try "help". > > > (rdb:1) > > > > Perhaps auto-eval is turned off in the debugger. Try typing "p > > @user_session" instead of "@user_session". > > > > And why are you using RSpec specs for your controllers, anyway? > > Cucumber stories are better for that. RSpec is better for model logic. > > > > > > > > > So, how does one go about debugging their tests, or rather specs, in > > > rspec? > > > > Best, > > -- > > Marnen Laibow-Koserhttp://www.marnen.org > > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Kahn
2010-Oct-10 18:39 UTC
Re: Re: ruby-debug does not invoke from rspec (rails 3 rspec beta 22)
Its interesting you just wrote this as right now I found an error where when vaidations fail on a page, the redirect is broken. My dilemma is that I could write a cuke test for this, but it really belongs to the controller. So this is where my blind spot is. I just hate the idea (because I become compulsive) to write a controller spec for every action and redirect, as many of these are role dependent too. I guess I have yet still to find a happy medium. On Sun, Oct 10, 2010 at 1:17 PM, attila.gyorffy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org < attila.gyorffy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i am having some issues around ruby-debug and rspec for rails3 so i > was doing a google search for a solution and came across this thread. > i''m sorry I couldn''t miss your thoughts on rppec vs cucumber and don''t > wanna play smarty pants here, i just think you cannot replace rppec > with cucumber because they are different tools really for different > purposes. > > i am also using cucumber for testing my projects'' integrity - hence > cucumber is for integration testing! - but also not lazy to write > specs for my controller tests. i found that writing unit tests with > rspec helps a lot while your project codebase grows and allows you to > identify failing scenarios much easier. i am also trying to be as > explicit in my tests as i can, covering edge cases etc. > > i would not use rspec with integrated views - never been a big fan of > that - but would definitely keep writing unit tests with rspec2 and > cover integration testing with cucumber. > > -- Attila > > On Sep 13, 6:49 pm, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > David Kahn wrote: > > > Ok, now I found if I add *require ''ruby-debug''* in the spec itself > > > the > > > debugger invokes. However.... > > > > > It is useless. I get a breakpoint in my controller but have no access > to > > > anything I want: > > > > > > ../Users/DK/Documents/ror/projects/wavelineup3/app/controllers/user_session > s_controller.rb:14 > > > respond_to do |format| > > > (rdb:1) @user_session > > > *** Unknown command: "@user_session". Try "help". > > > (rdb:1) self > > > *** Unknown command: "self". Try "help". > > > (rdb:1) params > > > *** Unknown command: "params". Try "help". > > > (rdb:1) > > > > Perhaps auto-eval is turned off in the debugger. Try typing "p > > @user_session" instead of "@user_session". > > > > And why are you using RSpec specs for your controllers, anyway? > > Cucumber stories are better for that. RSpec is better for model logic. > > > > > > > > > So, how does one go about debugging their tests, or rather specs, in > > > rspec? > > > > Best, > > -- > > Marnen Laibow-Koserhttp://www.marnen.org > > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.