Erik Osheim wrote:
> On Tue, Jul 07, 2009 at 01:42:23PM -0700, Michael G Schwern wrote:
>> At best you have the ability to group statements together into a test, but I
>> already have that without any intervening pseudo-block to get in the way of
>> debugging.
>
> Do you not have problems with tests dying?
Its not endemic, no. If they die, they fail. If they're supposed to die I
use Test::Exception.
I guess my test programs are short enough that its not a huge deal if some
test dies early and halts the test. [1]
> I may be dealing with
> particularly hairy code at work, but our packages had (have?) tons of
> tests which died in totally strange ways at non-obvious places. The big
> benefit I find from this approach is essentially wrapping all test
> code in something like:
>
> my $cat = eval {
> new_ok $cat, 'Cat';
> ok($obj->alive, "cat is alive");
> is($obj->age, 3, "cat is 3 years old");
> $cat;
> };
> ok(!$@, "cat tests did not die");
>
>> I like the direction, but it needs to show an advantage beyond a thick
>> crusting of sugar.
>
> I'd like to imagine that the benefits I get from this module are more
> than just feeding my sweet tooth. I suppose time will tell ;)
I have no doubt. I'm glad someone is running with the idea. Please don't let
my curmudgeonly replies get you down. I am firmly in the "get the testing
framework the hell out of my way" school of testing, but not everyone has to
enroll in that school.
[1] This might be seen as tacit approval for the "die on fail" approach but
its really "die on die". :)
--
184. When operating a military vehicle I may *not* attempt something
"I saw in a cartoon".
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/