Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Adrian (66)


The hats I wear at work include: accessibility consultant; information architect; software developer (of the agile/XP/TDD breed - mostly in Perl); usability consultant; web site designer. I'm very dull:-) . []

Journal of Adrian (66)

Saturday February 14, 2004
07:01 PM

Default test names in Test::Class

[ #17422 ]

Another week. Another Test::Class release.

A minor tweak to the new support for default test names. I also got around to documenting it :-) You can now do:

sub one_plus_one_is_two : Test { is 1+1, 2 }

and Test::Class will produce

ok 1 - one plus one is two

So as long as you name your methods well you don't have to add in a test name. Useful if you're writing in the one-test-per-method style.

That's it (apart from fixing MANIFEST so we actually include the tests for the new features from the last few releases - sigh...)

Resolution-o-meter: v1.0
Week: 7, 3 weeks behind
01-02-03-04-05-06-07 08 09 10 11 12 13
14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49 50 51 52

Holding steady at three weeks behind. See y'all next time.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Good God, who would write one test per method!?!?


    • Good God, who would write one test per method!?!?

      Heh ;-) See this thread [] on the TDD list for a looooong discussion of some of the pros and cons.

      Think of it as taking test isolation to the extreme. As soon as you have more than one test per-method you are potentially introducing dependencies between the tests. Instead push stuff out into the test fixtures and keep each test independent.

      I'm not convinced myself yet. However, since some people seem to be having some success with it I'm going to play w

    • Dave Astels talks more about having one assertion per test method [] for anybody who is interested.