[Cuis-dev] Enhancement proposal: Fail test when no assertion ran
Hernán Wilkinson
hernan.wilkinson at 10pines.com
Mon Apr 15 12:19:12 PDT 2024
I think I understand your point better now.
Correct me if I'm wrong, but you are saying that having Error as a
condition for handling an exception is too broad, that is why you say "What
that code is saying is "I know much better than anyone else because I know
how *every conceivable error, even the ones I never saw*", is that right?
If so, I agree with you, that is why you can have a block as a handling
condition and that is also why when testing for exceptions there should be
an assertion to check that the right assertion was signaled (for example
checking the message of the exception).
As a rule of thumb, I create new types of exceptions if there is a handling
condition for it, if not I reuse existing exception types.
On Mon, Apr 15, 2024 at 3:29 PM Andres Valloud <ten at smallinteger.com> wrote:
> Look at NegativePowerError>>defaultAction for an example that refutes
> your point about default handlers. You have to let that error happen so
> the right thing occurs. This is why on: Error do: is pretty bad.
>
> On 4/15/24 4:33 AM, Hernán Wilkinson wrote:
> > I do not agree with your point of view.
>
--
*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240415/b705dbb4/attachment.htm>
More information about the Cuis-dev
mailing list