Test::Inline::Content::Legacy(3pm)

Test::Inline::Content::Legacy3pm

Test::inline 2 content handler for legacy functions

Usage

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

Version

version 2.214

Overview

This 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.

Methods

new $CODE_ref

The "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.

coderef

The "coderef" accessor returns the "CODE" reference for the object

process $Inline $Script

The "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.

Support

See 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 [email protected] <mailto:[email protected]>).

Releases

10 releases since Debian 4.0 (Etch); the text changed 6 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9–10
  7. 11–13

Author

Adam Kennedy <[email protected]>

From libtest-inline-perl 2.214-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.