Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Passing Dynamic Value to Test::More tests

by xdg (Monsignor)
on Jan 19, 2006 at 12:10 UTC ( #524202=note: print w/replies, xml ) Need Help??


in reply to Re: Passing Dynamic Value to Test::More tests
in thread Passing Dynamic Value to Test::More tests

That's a great point. I use that pattern also for when I may want to skip a test file entirely if a test dependency isn't available.

use Test::More; eval { require Some::Crazy::Dependency }; if ($@) { plan skip_all => "Some::Crazy::Dependency not available"; } else { plan tests => 42; }

It could be done in a BEGIN block, too, but I find it more readable without them.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://524202]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2022-05-20 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?