|
NAMETest::Inline::Content::Legacy - Test::Inline 2 Content Handler for legacy functionsVERSIONversion 2.214SYNOPSISCustom script content generation using Test::Inline 2.000+ with a custom generator functionsmy $header = "...."; my $function = sub { my $Object = shift; my $Script = shift; return $header . $Script->merged_content; }; my $Inline = Test::Inline->new( ... file_content => $function, ); Migrating this same code to Test::Inline 2.100+ ContentHandler objects my $header = "...."; my $function = sub { my $Object = shift; my $Script = shift; return $header . $Script->merged_content; }; my $ContentHandler = Test::Inline::Content::Legacy->new( $function ); my $Inline = Test::Inline->new( ... ContentHandler => $ContentHandler, ); DESCRIPTIONThis class exists to provide a migration path for anyone using the custom script generators in Test::Inline via the "file_content" param.The synopsis above pretty much says all you need to know. METHODSnew $CODE_refThe "new" constructor for "Test::Inline::Content::Legacy" takes a single parameter of a "CODE" reference, as you would have previously provided directly to "file_content".Returns a new "Test::Inline::Content::Legacy" object, or "undef" if not passed a "CODE" reference. coderefThe "coderef" accessor returns the "CODE" reference for the objectprocess $Inline $ScriptThe "process" method works with the legacy function by passing the Test::Inline and Test::Inline::Script arguments straight through to the legacy function, and returning it's result as the return value.SUPPORTSee the main SUPPORT section.Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Inline> (or bug-Test-Inline@rt.cpan.org <mailto:bug-Test-Inline@rt.cpan.org>). AUTHORAdam Kennedy <adamk@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2003 by Adam Kennedy.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |