Test::Pod::Snippets

Test::Pod::Snippets is a Perl module to generate tests from pod code snippets.
Download

Test::Pod::Snippets Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yanick Champoux
  • Publisher web site:
  • http://search.cpan.org/~yanick/

Test::Pod::Snippets Tags


Test::Pod::Snippets Description

Test::Pod::Snippets is a Perl module to generate tests from pod code snippets. Test::Pod::Snippets is a Perl module to generate tests from pod code snippets.SYNOPSIS use Test::Pod::Snippets; my $tps = Test::Pod::Snippets->new(); $tps->generate_snippets( @pm_and_pod_files );Fact 1In a perfect world, a module's full API should be covered by an extensive battery of testcases neatly tucked in the distribution's t/ directory. But then, in a perfect world each backyard would have a marshmallow tree and postmen would consider their duty to circle all the real good deals in pamphlets before stuffing them in your mailbox. Obviously, we're not living in a perfect world.Fact 2Typos and minor errors in module documentation. Let's face it: it happens to everyone. And while it's never the end of the world and is prone to rectify itself in time, it's always kind of embarassing. A little bit like electronic zits on prepubescent docs, if you will.Test::Pod::Snippets's goal is to address those issues. Quite simply, it extracts verbatim text off pod documents -- which it assumes to be code snippets -- and generate test files out of them.HOW TO USE TEST::POD::SNIPPETS IN YOUR DISTRIBUTIONIf you are using Module::Build, add the following to your Build.PL: my $builder = Module::Build->new( # ... your M::B parameters PL_files => { 'script/test-pod-snippets.PL' => q{} }, add_to_cleanup => , );Then create the file script/test-pod-snippets.PL, which should contains use Test::Pod::Snippets; my $tps = Test::Pod::Snippets->new; $tps->generate_snippets( qw# lib/your/module.pm lib/your/documentation.pod #);And you're set! Running Build should now generate one test file for each given module.If you prefer to generate the tests yourself, skip the modifications to Build.PL and call test-pod-snippets.PL from the distribution's main directory. Requirements: · Perl


Test::Pod::Snippets Related Software