annotate _test/Test/Web/View.pm @ 183:2184fa28b49e

IMPL::Web::View::TTLoader tests
author cin
date Wed, 28 Mar 2012 17:28:51 +0400
parents
children 7525ea9a071a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
1 package Test::Web::View;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
2 use strict;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
3 use warnings;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
4
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
5 use parent qw(IMPL::Test::Unit);
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
6 __PACKAGE__->PassThroughArgs;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
7
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
8 use IMPL::Test qw(assert test);
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
9 use IMPL::Web::View::TTLoader();
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
10
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
11 use constant {
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
12 TTLoader => typeof IMPL::Web::View::TTLoader
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
13 };
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
14
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
15 test TemplateLoaderTests => sub {
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
16 my ($this) = @_;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
17
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
18 my $loader = TTLoader->new(
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
19 {
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
20 INCLUDE_PATH => [
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
21 $this->GetResourceDir('Resources')
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
22 ]
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
23 },
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
24 ext => '.tt'
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
25 );
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
26
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
27 assert( defined(my $tt = $loader->template('simple') ) );
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
28
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
29 $tt;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
30 };
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
31
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
32 1;