File: | t/view.t |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | #!/usr/bin/env perl -w | ||||||
2 | 1 1 1 | 92 9 9 | use strict; | ||||
3 | 1 1 1 | 113 5 18 | use Test::More tests => 3; | ||||
4 | 1 1 1 | 84 4 13 | use FindBin qw($Bin); | ||||
5 | |||||||
6 | 1 1 1 | 75 5 15 | use Railsish::View; | ||||
7 | |||||||
8 | 1 | 16 | my $view = Railsish::View->new( | ||||
9 | template_root => "$Bin/app2/app/views" | ||||||
10 | ); | ||||||
11 | |||||||
12 | { | ||||||
13 | 1 1 | 122 10 | my $html = $view->render("welcome/index", layout => undef); | ||||
14 | 1 | 71 | is $html,"<h1>Welcome</h1>\n"; | ||||
15 | } | ||||||
16 | |||||||
17 | { | ||||||
18 | 1 1 | 4 8 | my $html = $view->render("welcome/index"); | ||||
19 | 1 | 53 | like $html, qr/Welcome/; | ||||
20 | } | ||||||
21 | |||||||
22 | { | ||||||
23 | 1 1 | 9 10 | my $html = $view->render(file => "welcome/index.html.tt2"); | ||||
24 | 1 | 49 | like $html, qr/Welcome/; | ||||
25 | } |