![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
[solved] Test question: how to exercise conditional module load?by radiantmatrix (Parson) |
on Jun 17, 2008 at 19:54 UTC ( [id://692580]=perlquestion: print w/replies, xml ) | Need Help?? |
radiantmatrix has asked for the wisdom of the Perl Monks concerning the following question: I like to use Devel::Cover to make sure that my test suite adequately covers my code. I've run into a bit of a conundrum on how to test something.
Yes, I know I could use Best (use Best qw/YAML::Syck YAML/;), but for this project, it's not an option due to bureaucratic considerations. My problem is that my tests only exercise the statements in #1, and not in #2 -- or vice-versa. I'm looking for a way that my test script can, e.g. temporarily make require YAML::Syck or YAML::Syck->import die so that I can automatically prove the fallback works. I have tried to search for answers, but can't seem to find a set of search terms that provides any enlightenment. So, I turn to the Monestary: any ideas? Updates:
<–radiant.matrix–>
Ramblings and references “A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” — Herm Albright I haven't found a problem yet that can't be solved by a well-placed trebuchet
Back to
Seekers of Perl Wisdom
|
|