summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-03-24 13:38:49 -0500
committerJesse Luehrs <doy@tozt.net>2011-03-24 13:38:49 -0500
commit43e03c4df4e9ba62a08805623e37d3b8bbd33627 (patch)
treecbe1f17d5bcc9846a83888f7733148faa714ea9b
parentc77d637ae9047507b49f7c298f17fa53bddcdcb1 (diff)
downloadox-view-tt-43e03c4df4e9ba62a08805623e37d3b8bbd33627.tar.gz
ox-view-tt-43e03c4df4e9ba62a08805623e37d3b8bbd33627.zip
whoops, forgot to update these tests
-rw-r--r--t/01-basic.t26
-rw-r--r--t/data/01/templates/foo.tt2
2 files changed, 18 insertions, 10 deletions
diff --git a/t/01-basic.t b/t/01-basic.t
index ef89f37..f3f5987 100644
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -35,16 +35,24 @@ use Path::Class ();
package Foo;
use OX;
- config template_root => sub {
- Path::Class::dir($FindBin::Bin)->subdir('data', '01', 'templates')
- };
+ has template_root => (
+ is => 'ro',
+ isa => 'Str',
+ block => sub {
+ Path::Class::dir($FindBin::Bin)->subdir('data', '01', 'templates')->stringify
+ },
+ );
- component View => 'OX::View::TT', (
- template_root => depends_on('/Config/template_root'),
+ has view => (
+ is => 'ro',
+ isa => 'OX::View::TT',
+ dependencies => ['template_root'],
);
- component Controller => 'Foo::Controller', (
- view => depends_on('/Component/View'),
+ has controller => (
+ is => 'ro',
+ isa => 'Foo::Controller',
+ dependencies => ['view'],
);
router as {
@@ -52,11 +60,11 @@ use Path::Class ();
content => 'Hello world',
);
route '/foo' => 'root.foo';
- }, (root => depends_on('/Component/Controller'));
+ }, (root => depends_on('controller'));
}
my $foo = Foo->new;
-my $view = $foo->resolve(service => '/Component/View');
+my $view = $foo->view;
isa_ok($view, 'OX::View::TT');
isa_ok($view->tt, 'Template');
diff --git a/t/data/01/templates/foo.tt b/t/data/01/templates/foo.tt
index 8bd1950..f3acdb5 100644
--- a/t/data/01/templates/foo.tt
+++ b/t/data/01/templates/foo.tt
@@ -1 +1 @@
-<p>[% r.path_info %]</p>
+<p>[% uri_for('action' => action, 'controller' => controller) %]</p>