On Fri Aug 01 02:34:08 2008, NUFFIN wrote:
Show quoted text> Test::use::ok is very minimal:
>
> BEGIN { use_ok("foo") }
>
> becomes
>
> use ok "foo";
>
> which is very helpful for people who forget BEGIN.
>
> It's fairly popular and not a tricky dep, so I am hoping Test::Most
> will encourage its adoption by
> bundling it too (just a dep really).
I've tentatively added this, but it's in my git repository and not on
the CPAN:
http://github.com/Ovid/test--most/tree/master
My only problem with Test::use::ok is that what programmers *really*
want is this:
BEGIN { use_ok $some_module or die }
You want failure to "use" a module to be fatal, regardless of whether or
not a Test::Most user has asked for 'die' or 'bail' on failure. That's
because the test could fail but you could still wind up with partially
compiled code in memory and if the first failure isn't noticed, it can
be very, very hard to debug.
I've had this happen to me and I know others who have had this or
complained about it. Thus, I don't think "use ok My::Module" is really
what people want, particularly since, unlike the BEGIN variant, they
can't add 'or die' to the end.
Cheers,
Ovid