Wait just a second.

As far as I'm concerned, I WANT my tests to be right there in my code. Maybe not as the final form in which it will be used, but certainly in the "source source" version.

That's what Test::Inline was written for. Being able to do something like the following is a god-send.
=pod Document method here =begin testing my $Test = Foo::Bar->new('blahblah'); is( $Test->whacko, 1, "'blahblah' new Foo::Bar is whacko" ); =end testing =cut sub new { ... }

The simple script that comes with Test::Inline sucks out the tests, builds it a .t script, and whenever you change the name of a method or the way it works, you can just add tests right there. The test scripts recompile to reflect the change.

I liked this so much I wrote Test::Inline::Heavy ( as yet unreleased ) to add per-method and per-module dependancy-based ordering, and scale it up to handle dozens of classes compiling down to one script per-module.

And it's awesome when building for clients, you can easily maintain vast numbers of tests in-place, written by different people, and when you roll it out to the client you compile the tests to get a single cohesive test directory, and then remove the relevant sections of the pod to help maintain clarity for their QA/debugging people.

In reply to Re^2: What is wrong with testing like a noob by adamk
in thread What is wrong with testing like a noob by dimar

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.