1Test::Inline::Content::ULseegracCyo(n3t)ributed Perl DocTuemsetn:t:aItniloinne::Content::Legacy(3)
2
3
4
6 Test::Inline::Content::Legacy - Test::Inline 2 Content Handler for
7 legacy functions
8
10 Custom script content generation using Test::Inline 2.000+ with a cus‐
11 tom generator functions
12
13 my $header = "....";
14 my $function = sub {
15 my $Object = shift;
16 my $Script = shift;
17 return $header . $Script->merged_content;
18 };
19
20 my $Inline = Test::Inline->new(
21 ...
22 file_content => $function,
23 );
24
25 Migrating this same code to Test::Inline 2.100+ ContentHandler objects
26
27 my $header = "....";
28 my $function = sub {
29 my $Object = shift;
30 my $Script = shift;
31 return $header . $Script->merged_content;
32 };
33
34 my $ContentHandler = Test::Inline::Content::Legacy->new( $function );
35
36 my $Inline = Test::Inline->new(
37 ...
38 ContentHandler => $ContentHandler,
39 );
40
42 This class exists to provide a migration path for anyone using the cus‐
43 tom script generators in Test::Inline via the "file_content" param.
44
45 The synopsis above pretty much says all you need to know.
46
48 new $CODE_ref
49
50 The "new" constructor for "Test::Inline::Content::Legacy" takes a sin‐
51 gle parameter of a "CODE" reference, as you would have previously pro‐
52 vided directly to "file_content".
53
54 Returns a new "Test::Inline::Content::Legacy" object, or "undef" if not
55 passed a "CODE" reference.
56
57 coderef
58
59 The "coderef" accessor returns the "CODE" reference for the object
60
61 process $Inline $Script
62
63 The "process" method works with the legacy function by passing the
64 Test::Inline and Test::Inline::Script arguments straight through to the
65 legacy function, and returning it's result as the return value.
66
68 See the main SUPPORT section.
69
71 Adam Kennedy <adamk@cpan.org>, <http://ali.as/>
72
74 Copyright 2004 - 2007 Adam Kennedy.
75
76 This program is free software; you can redistribute it and/or modify it
77 under the same terms as Perl itself.
78
79 The full text of the license can be found in the LICENSE file included
80 with this module.
81
82
83
84perl v5.8.8 2007-08-17 Test::Inline::Content::Legacy(3)