man Test::Inline::Content::Legacy () - Test::Inline 2 Content Handler for legacy functions

NAME

Test::Inline::Content::Legacy - Test::Inline 2 Content Handler for legacy functions

SYNOPSIS

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,
        );

DESCRIPTION

This class exists to provide a migration path for anyone using the custom script generators in Test::Inline via the CWfile_content param.

The synopsis above pretty much says all you need to know.

METHODS

The CWnew constructor for CWTest::Inline::Content::Legacy takes a single parameter of a CWCODE reference, as you would have previously provided directly to CWfile_content.

Returns a new CWTest::Inline::Content::Legacy object, or CWundef if not passed a CWCODE reference.

coderef

The CWcoderef accessor returns the CWCODE reference for the object The CWprocess 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.

SUPPORT

See the main SUPPORT section.

AUTHOR

Adam Kennedy <cpan@ali.as>, <http://ali.as/>

COPYRIGHT

Copyright (c) 2004 - 2005 Phase N Austalia. All rights reserved.

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 LICENSE file included with this module.