[rspec-devel] [ rspec-Bugs-13141 ] backtrace should only be tweaked at end, not beginning

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 18 23:05:33 EST 2007


Bugs item #13141, was opened at 2007-08-16 17:15
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13141&group_id=797

Category: runner module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Jay Levitt (jaylev)
Assigned to: Nobody (None)
Summary: backtrace should only be tweaked at end, not beginning

Initial Comment:
Imagine this failing view spec:

describe "this spec" do
  it "should fail" do
    form_for(nil,nil){}
  end
end

The output is:

NoMethodError in 'LabelledBuilderHelper providing labelled_form_for should fail'
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
./spec/helpers/labelled_builder_helper_spec.rb:4:
script/spec:4:

But of course there is no << in line 4 of this spec.  The error happened inside form_for, and thus the error message is tweaked away.

I think tweak_backtrace should only eliminate those matching lines that occur at the end of the backtrace - i.e. the many parent classes of rails.  Ya?


----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-18 23:05

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/60-13141-backtrace-should-only-be-tweaked-at-end-not-beginning#ticket-60-2

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-21 14:39

Message:
Great. Thanks for playing!

----------------------------------------------------------------------

Comment By: Ryan Bates (ryanb)
Date: 2007-08-21 14:35

Message:
I understand now. Sorry for the confusion. I see there's a separate ticket [#13020] which (I think) covers the problem I am having. I'll post over there.

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-21 14:27

Message:
Jay's problem is that the filtered backtrace is lying about the location of the error. The backtrace you posted is a complete backtrace and tells you exactly where to look to debug the problem. Two completely separate issues.

----------------------------------------------------------------------

Comment By: Ryan Bates (ryanb)
Date: 2007-08-21 14:22

Message:
Is this problem unrelated to the backtrace tweaker then? From my understanding that just removes some lines of the backtrace.

Either way, I'm sure my problem is the same as mentioned in this ticket. It's a helper spec and I'm getting the same error message. Here's the full backtrace: http://pastie.caboo.se/89745

I'm on edge rails as you can probably tell. Maybe that is part of the problem?

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-21 13:53

Message:
Ryan - this is a request for a different backtrace, not a full backtrace. You can already get a full backtrace with the -b option.

----------------------------------------------------------------------

Comment By: Ryan Bates (ryanb)
Date: 2007-08-21 13:39

Message:
+1

I'm running into this problem and it makes it very difficult to debug without a full stack trace.


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13141&group_id=797


More information about the rspec-devel mailing list