Using Test::MockObject For Good And Evil

jk2addict on 2005-03-17T16:36:42

I've posted this at PerlMonks, but it's worth some time here as well.

I'm entertaining the idea of writing Test::CPANTS. During the development process, I want to be able to test my kwalitee rating (keeping it at 16) every time I get ready to release a new version of a module.

I've taken a look and Modules::CPANTS::Generator. Most of it looks reusable (like the individual test modules); but a good portion of it ::Generator seems to be based around the idea the I'm going to download a dist and use that. In the case of a Test::CPANTS, I'm really trying to work with the local lib/blib part of the dist to be tested.

This brings my to my question. Is it ok to use Test::MockObject for good (test.pl, t/*.t) AND evil; fooling Modules::CPANTS::Generator into using my local hacks to get it and CPANPLUS to not download things, but intead to use the local dist directory and a non-existant .tar.gz dist?


Re: Test::CPANTS

domm on 2005-03-18T08:27:22

One I thing I have on my CPANTS TODO list for ages is something like a 'lint' script which just takes a dist (Foo-Bar-0.42.tgz) ans runs all CPANTS tests on it. So one can check for kwalitee before uploading to CPAN and then beeing publicly humilated :-)

In theroy you should be able to use all the various Module::CPANTS::Generator::* modules and the test contained in them, but I never actually tried it. Hmm, mabye it's time for more CPANTS refactoring...

Re: Test::CPANTS

jk2addict on 2005-03-18T21:52:39

Or, maybe it's time for me to seek professional care for spending so much time worrying about my kwalitee scores. :-)