3 # test apparatus for Text::Template module
8 use Test::More tests => 3;
11 use_ok 'Text::Template' or exit 1;
13 my $template = Text::Template->new(
15 SOURCE => q{My process ID is {$$}});
17 my $of = File::Temp->new;
19 my $text = $template->fill_in(OUTPUT => $of);
21 # (1) No $text should have been constructed. Return value should be true.
24 close $of or die "close(): $!";
26 open my $ifh, '<', $of->filename or die "open($of): $!";
29 { local $/; $t = <$ifh> }
32 # (2) The text should have been printed to the file
33 is $t, "My process ID is $$";