[rspec-users] error message feedback

David Chelimsky dchelimsky at gmail.com
Wed Jul 29 08:12:36 EDT 2009


On Tue, Jul 28, 2009 at 8:03 PM, rogerdpack<rogerpack2005 at gmail.com> wrote:
> Question.
>
> Currently with this test:
>
>  instance.splatted3().should raise_error(ArgumentError)

This should be:

  lambda { instance.splatted3() }.should raise_error(ArgumentError)

See http://rspec.rubyforge.org/rspec/1.2.8/classes/Spec/Matchers.html#M000450
for more info.

HTH,
David

>
> if it's broken, and returns [] instead of raising appropriately,
> currently the error reported is:
>
> expected ArgumentError, got #<NoMethodError: undefined method `call'
> for []:Array>
>
> shouldn't this have been reported as
>
> expected ArgumentError, got []
>
> ?
> Much thanks.
> =r
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list