I prefer anything that helps automate the tests, so interactive prompts are a drawback. They can still be handy as a fall back when there isn't any environment variable or config file available, but don't force someone to type in additional info every time the tests are run.

The Test::Cmd module provides a model for reading and writing files for testing. It's based on the testing conventions for the Aegis change management system: all files get created in one or more temporary directories; you don't rely on being in any special directory or having any special config files in place for the tests to run. Test::Cmd provides a portable API for managing this and cleaning up afterwards.

If you don't find Test::Cmd useful for your purposes, you might get some ideas from looking at the tests for the module, which do this same sort of test-file management without using Test::Cmd itself.

In reply to Re: Complex module testing by knight
in thread Complex module testing by Anonymous Monk

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.