Test::inline 2 content handler for legacy functions
Custom script content generation using Test::Inline 2.000+ with a custom generator functions
my $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, );
This class exists to provide a migration path for anyone using the custom script generators in Test::Inline via the \*(C`file_content\*(C' param.
The synopsis above pretty much says all you need to know.
The \*(C`new\*(C' constructor for \*(C`Test::Inline::Content::Legacy\*(C' takes a single parameter of a \*(C`CODE\*(C' reference, as you would have previously provided directly to \*(C`file_content\*(C'.
Returns a new \*(C`Test::Inline::Content::Legacy\*(C' object, or \*(C`undef\*(C' if not passed a \*(C`CODE\*(C' reference.
The \*(C`coderef\*(C' accessor returns the \*(C`CODE\*(C' reference for the object The \*(C`process\*(C' 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.
See the main \s-1SUPPORT\s0 section.
Adam Kennedy <[email protected]>, <http://ali.as/>
Copyright 2004 - 2013 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the \s-1LICENSE\s0 file included with this module.