>>>>> "David" == David Golden <xda...@gmail.com> writes:

David> I wonder how many people are using subtests with a plan and how many
David> are replying on the implied "done_testIng" feature.

I'm teaching it now, and I find it very valuable.

    subtest 'network tests' => sub {
            $ENV{NETWORK_TESTS} or plan skip_all => 'skipping network tests';
            ...
    };

    subtest 'tolerate partial failure' => sub {
            ...
            is($foo, $bar, 'foo is bar') or return;
            ...
            tests that depend on $foo is $bar, and would all fail without
            ...
    };

Far easier than the old way of counting all the skipped tests and
performing skips depending on success.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

Reply via email to