[tpm] Follow-up on Feb 2012 Testing Talk

Olaf Alders olaf at vilerichard.com
Sat Mar 3 19:17:08 PST 2012


On 2012-03-03, at 10:13 AM, Rob Janes wrote:

> ## this tests the useability of the package
> 
> BEGIN {
>   use_ok('Compress::Bzip2');
> };

I've got use_ok() and require_ok() all over a lot of my tests, but I recently moved away from that to new_ok() after finding out that it exists.  Also, there is some discussion as to the usefulness of require_ok(), because of subtle problems it can introduce.  Here's a helpful comment from Ovid about avoiding use_ok() and require_ok():

http://www.dagolden.com/index.php/1322/five-testmore-features-you-might-not-be-using-yet/#comment-6218

Also, I should note that the entire blog post is well worth reading.  This is where I was made aware of new_ok().

Best,

Olaf
--
Olaf Alders
olaf at vilerichard.com

http://vilerichard.com -- folk rock
http://twitter.com/vilerichard
http://cdbaby.com/cd/vilerichard 






More information about the toronto-pm mailing list