File: before_output.t

package info (click to toggle)
libhtml-template-pluggable-perl 0.17%2B~cs0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 276 kB
  • sloc: perl: 401; makefile: 17
file content (34 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use Test::More;
use Data::Dumper;

use strict;

plan tests => 1						# use_ok
			+ 2						# my tests
	;

use_ok('HTML::Template::Pluggable');

{
	my $t = HTML::Template::Pluggable->new(
			scalarref	=> \q{nothing},
			debug		=> 0,

			);
	$t->add_trigger('before_output', sub { diag("trigger called with @_") if $_[0]->{options}->{debug} } );

	ok($t->output eq 'nothing');
}

{
	my $t = HTML::Template::Pluggable->new(
			scalarref	=> \q{<tmpl_var before_output>},
			debug		=> 0,

			);
	$t->add_trigger('before_output', sub { my $self = shift; $self->param('before_output' => 'before output'); } );

	ok($t->output eq 'before output');
}

__END__