root/Template-Plugin-ResolveLink/trunk/t/01_resolve.t

Revision 1986 (checked in by miyagawa, 14 years ago)

import Template::Plugin::ResolveLink?

Line 
1 use Test::Base;
2 use Template;
3 use Template::Plugin::ResolveLink;
4
5 plan tests => 1 * blocks;
6
7 run {
8     my $block = shift;
9     my $tt = Template->new;
10     $tt->process(\$block->input, {}, \my $out)
11         or do { fail $tt->error; next };
12     is $out, $block->expected;
13 };
14
15 __END__
16 ===
17 --- input
18 [% USE ResolveLink -%]
19 [% FILTER resolve_link base = "http://www.example.com/base/" -%]
20 <a href="foo.html"><img src="/bar.gif"></a>
21 <a href="mailto:bar">foo</a>
22 [% END -%]
23 --- expected
24 <a href="http://www.example.com/base/foo.html"><img src="http://www.example.com/bar.gif"></a>
25 <a href="mailto:bar">foo</a>
26
Note: See TracBrowser for help on using the browser.