| 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 10 | use strict; | ||||
| 3 | 1 1 1 | 114 5 18 | use Test::More tests => 3; | ||||
| 4 | 1 1 1 | 87 4 15 | use FindBin qw($Bin); | ||||
| 5 | |||||||
| 6 | 1 1 1 | 88 5 15 | use Railsish::View; | ||||
| 7 | |||||||
| 8 | 1 | 17 | my $view = Railsish::View->new( | ||||
| 9 | template_root => "$Bin/app2/app/views" | ||||||
| 10 | ); | ||||||
| 11 | |||||||
| 12 | { | ||||||
| 13 | 1 1 | 3 10 | my $html = $view->render("welcome/index", layout => undef); | ||||
| 14 | 1 | 68 | is $html,"<h1>Welcome</h1>\n"; | ||||
| 15 | } | ||||||
| 16 | |||||||
| 17 | { | ||||||
| 18 | 1 1 | 2 8 | my $html = $view->render("welcome/index"); | ||||
| 19 | 1 | 47 | like $html, qr/Welcome/; | ||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | { | ||||||
| 23 | 1 1 | 9 9 | my $html = $view->render(file => "welcome/index.html.tt2"); | ||||
| 24 | 1 | 43 | like $html, qr/Welcome/; | ||||
| 25 | } | ||||||