File: class.t

package info (click to toggle)
libtemplate-plugin-class-perl 0.14-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 64 kB
  • sloc: perl: 55; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!perl -w
use strict;
use Test::More tests => 2;
use Template;
my $tt = Template->new;

my $template = "[% USE foo=Class('Foo') %][% foo.bar %]";
my $out;
ok( $tt->process(\$template, {}, \$out), "processed ok" );
# Template->error changed what it returns for no error - but this test was
# bogus anyhow
#is( $tt->error, undef, "no error" );

is( $out, Foo->bar, "method was called" );

BEGIN { $INC{'Foo.pm'} = 1 }
package Foo;
sub bar {
    "I am returning bar";
}