A fresh Outlook

barbie on 2007-05-09T08:43:08

The latest version of Mail-Outlook is now on CPAN. I've been getting a lot of interest in the module over the last year, and while there have been a few patches and suggestions, there was one bug that seemed fine to me, but wasn't for others. However, having finally spotted that my testing was loading an older version of the distribution and not the latest, I soon found the bug. Part of the problem is that I wrote the module for my CPAN Testing work, but seeing as I'm not running tests at the moment, I hadn't noticed the bug. Now I'm using the module for real work, so I've had a need to fix it. As a consequence I've also implemented the Sent/Received methods to return the date/time a message was sent/received. This was actually easier to implement than I thought, and I'm kind of surprised I didn't introduce it earlier.

I've also added lots of tests. So much so that my Devel::Cover(age) is now over 84%. However, due to the nature of some of the tests, I've disabled one of the scripts by default. The tests in question will read your messages in your Inbox. As some are rightly concerned with security, these will only be enabled if your set the environment variable PRIVATE_TESTS. This kind of testing has often been discussed on perl-qa and module-authors, but I don't think there has ever been an agreement as to what to call the environment variable. So now I've gone and added yet another!

However, the most interesting set of tests were the ones where I wanted to test for failure. Due to the way mocking works, I couldn't properly test the modules without turning strict off. But as I didn't want to upload the distribution with strict turned off, this looked like a non-starter. Then I took a look at Acme-USIG and learnt this sneaky trick:

*strict::import = sub { $^H };

So Acme modules can be useful sometimes ;)