Test::StubGenerator

Test::StubGenerator is a simple module that analyzes a given source file and automatically generates t/*.t style tests.
Download

Test::StubGenerator Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Kent Cowgill
  • Publisher web site:
  • http://search.cpan.org/~kcowgill/Test-StubGenerator-0.9.5/lib/Test/StubGenerator.pm

Test::StubGenerator Tags


Test::StubGenerator Description

Test::StubGenerator is a simple module that analyzes a given source file and automatically generates t/*.t style tests. Test::StubGenerator is a simple module that analyzes a given source file and automatically generates t/*.t style tests for subroutines/methods it encounters.SYNOPSIS use Test::StubGenerator; my $stub = Test::StubGenerator->new( { file => '/path/to/MyModule.pm', tidy => 1, } ); print $stub->gen_testfile;Or, from the command line (split for easier reading): $ perl -MTest::StubGenerator -e ' > my $stub = Test::StubGenerator->new({ file => "Module.pm" }); > print $stub->gen_testfile;' > Module.tTest::StubGenerator is a module that attempts to analyze a given source file and automatically create testing stubs suitable for unit testing your code.Test::StubGenerator make use of PPI in order to parse your code, looking for constructors and methods for modules (.pm), and subroutines for Perl script files (.pl).Test::StubGenerator also runs the generated tests through Perl::Tidy before returning the text of the tests to you, though this can be disabled.The idea for Test::StubGenerator grew out of a vim plugin I wrote that created test stub files in a very similar fashion. However, the line-based nature of vimscript quickly indicated that adding default parameters to the tests would prove to be an exercise in futility. As this was a feature I very much wanted to implement, I naturally turned to Perl, and PPI. Requirements: · Perl


Test::StubGenerator Related Software