[rspec-devel] [ rspec-Feature Requests-5485 ] proc#should_raise and proc#should_not_raise output

noreply at rubyforge.org noreply at rubyforge.org
Thu Feb 8 09:26:29 EST 2007


Feature Requests item #5485, was opened at 2006-08-21 20:57
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=5485&group_id=797

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Judson Lester (nyarly)
Assigned to: Nobody (None)
Summary: proc#should_raise and proc#should_not_raise output

Initial Comment:
Currently 

lamba do
  raise "Dumb example"
end.should_not_raise

outputs the backtrace of the Spec::Api::ExpectationNotMet exception.  Which isn't very useful.  It'd rock if instead it output the exception that was raised in the Proc that broke the expectation.  Likewise, should_raise doesn't print the backtrace of wrong exceptions.

More detail as I understand how to post them.

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-08 14:26

Message:
The simplest thing would be to simply re-raise ANY errors that are raised that don't match the expectation, but you would lose the "expected x, got y" information.

We could document that this expectation behaves slightly differently from the rest.

Would that be acceptable?

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-08-21 22:48

Message:
I think I understand what you mean. A more illustrative and realistic example would be to have the spec invoke a method defined somewhere else - and have that method raise "Dumb example".

And you want to see the stack trace of that exception so you can find the source.

Makes sense!

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

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


More information about the rspec-devel mailing list