First question is, do you use Test::More's improvements? I find that the standard Test module covers basic tests pretty well. No sense using Test::More unless you need it.

If you decide that you truly need Test::More's added flexibility, you can add a PREREQ_PM attribute to your WriteMakefile() call in Makefile.PL. It's a hashref, with the names being the module names and the values being the version number required for your script to run. Version number '0' means 'Any version'. Here's what it would be for a module called 'Devel::Refactorizer':

WriteMakefile( 'NAME' => 'Devel::Refactorizer', 'VERSION_FROM' => 'Refactorizer.pm', # finds $VERSION 'PREREQ_PM' => { 'Test::More' => 0}, # e.g., Module::Name +=> 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'Refactorizer.pm', # retrieve abstract from mo +dule AUTHOR => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : +()), );

Truth in advertising: much of what I'm saying here is stuff I'm reading from the documentation right now for the first time. :)

If you were to install this module using CPAN, it would first attempt to do a 'make' on the distribution. This attempt would fail, since the Makefile will complain about lacking the Test::More module. Then, the CPAN module would download Test::More, build it, and then re-run 'make' on the Refactorizer. CPAN runs 'make test' after 'make', so Test::More would be in place for the tests.

Another approach: some folks bundle Test::More along with their module distributions. I personally think that this method clutters CPAN; observe what happens when you search for Test::More with search.cpan.org. However, it's a fairly small module, and some pretty bright people take this approach, so YMMV.

stephen


In reply to Re: Use a standard module or a "better" one, and how to make installing it troublefree. by stephen
in thread Use a standard module or a "better" one, and how to make installing it troublefree. by Dog and Pony

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.