Perl::QA Hackathon in Lyon - Day 2

I've just released Test::Class::Moose version 0.50. The major feature you'll notice are the Test and Tests attributes. They're included to make it easier to migrate from Test::Class.

sub this_is_a_test : Test {
    pass 'we have a single test';
}

sub another_test_method : Tests { # like "no_plan"
    # a bunch of tests
}

sub yet_another_test_method : Tests(7) { # sets plan to 7 tests
    ...
}

And for those already familiar with TCM, you'll note that if you use a Test/Tests attribute, it's automatically a test method and the method name no longer needs to be prefixed with test_.

There are also some minor tweaks that I made to parallel testing (internals cleanup, mostly).

For those wondering why you would use Test::Class::Moose: if someone builds a web site out of hundreds of separate scripts with embedded SQL and printing output directly, we call it legacy crap ... but we're perfectly OK with that in a test suite.

Treat your test code as well as your regular code. Don't just slap something together and hope it works.

Update: Thinking about simply declaring Sub::Attribute as a dependency rather than making it optional. It would simplify the code internally, but the magic of Sub::Attribute could conceivably break at some point? Thoughts?

If you're interested in hiring me or any of the talented developers we have working at All Around The World, drop me a line at ovid@allaroundtheworld.fr.

Leave a comment

About Ovid

user-pic Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/