in reply to Re^3: Is "ref($class) || $class" a bad thing?
in thread Is "ref($class) || $class" a bad thing?
I'm suggesting (as I think your conclusion supports) that if you have to abuse your API to test the possibilities that your code should support, you have a mismatch somewhere.
Well, if you want to support Foo::new() then it would not be abusing the API, it would be testing a feature. If you want to punish those who abuse your API, then I think it is appropriate to test it for the error/exception.
However, if test it because you just want 100% coverage, then you probably just need to relax.
I guess my feeling is that I want to punish those who abuse my API, maybe that is not so perl-ish, and maybe its a little control-freaky, but I like knowing that my module will perform as expected under both intended and unintended conditions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Is "ref($class) || $class" a bad thing?
by chromatic (Archbishop) on Jul 12, 2004 at 21:20 UTC | |
by stvn (Monsignor) on Jul 12, 2004 at 22:29 UTC | |
by chromatic (Archbishop) on Jul 12, 2004 at 23:26 UTC | |
by stvn (Monsignor) on Jul 13, 2004 at 01:39 UTC |