in reply to Keeping SKIP Test Blocks Under Control
Good news! You don't have to nest the skip blocks ;-) Something like:
SKIP: { ok( $mech->response->is_success, "Request is successful" ) or skip "Unsuccessful request", 4; ok( $mech->is_html, "Returns HTML" ) or skip "Didn't return HTML", 3; ok( $mech->title eq 'some title', "Returns expected title" ); my @forms = $mech->forms; ok( @forms >= 1, "Has at least one form" ) or skip "Need at least one form to work on", 1; my ($passwd_form) = @forms; ok( $passwd_form->action eq 'example.cgi', "action goes to correct CGI" ); }
should work just fine.
Also, you could always just not have a test plan and use a plain return to skip unnecessary tests.
Finally, another alternative would be to use something like Test::Block which would save you having to keep track of the number of remaining tests in the skip block.
In fact - I should really go release Test::Block to CPAN since its actually fairly useful. I'll dig it out and you should be able to use it later tonight :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Keeping SKIP Test Blocks Under Control
by chromatic (Archbishop) on Apr 12, 2004 at 17:58 UTC | |
by adrianh (Chancellor) on Apr 12, 2004 at 18:44 UTC |