[Rspec-devel] Feature requests

aslak hellesoy aslak.hellesoy at gmail.com
Sun Aug 20 22:31:14 EDT 2006

On 8/16/06, Judson Lester <nyarly-rspec at redfivellc.com> wrote:
> I've run into a couple of minor irritations working with rspec recently.
> Mostly, I really like working with rspec.  Tidy DSL, good Rake
> integration, built in mocks and coverage are all major boons.  But:
> proc.should_raise and should_not_raise both result in printing the
> backtrace of the the RSpec failure they raise, rather than the
> unexpected exception that was raised.  This leads to a fair amount of
> extra dev time spent hunting down the error, where a message along the
> lines of "proc should not have raised, but instead raised:" and the
> whole exception (not the standard Ruby "...400 lines skipped that
> include the line you care about..." :)

Could you please submit an RFE for this? Preferrably in the form of a
patch that we can apply and reproduce what you're getting. I'm not
sure how you're getting 400 lines of trace. Are you on Rails? In that
case - you can write the patch against the semo app under

> Contrarywise, other expectations also print their entire backtrace,
> which is rarely helpful and consumes a fair amount of scrollback and
> attention.

Really? We're stripping off most of the backtraces already. See spec's
-b command line option. How can I reproduce a long backtrace as you

> Finally hash.should_has_key(:key) fails (<hash> doesn't respond to has?)
> as do similar predicates (i.e. anything with an underscore).

You can do this with should_include(:key)

> It wouldn't hurt if mocks passed .and_return([1,2,3]) would treat that
> as an expectation to be called at least 3 times, and warn if they were
> told otherwise - it's certainly not Least Surprise when the class being
> specced against fails because it's getting the wrong result.
> Am I the voice in the wilderness here?  I'm more than willing to submit
> patches, if there's some chance they'll be accepted.
> Judson
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the Rspec-devel mailing list