From 43e03c4df4e9ba62a08805623e37d3b8bbd33627 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 24 Mar 2011 13:38:49 -0500 Subject: whoops, forgot to update these tests --- t/01-basic.t | 26 +++++++++++++++++--------- t/data/01/templates/foo.tt | 2 +- 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 @@ -

[% r.path_info %]

+

[% uri_for('action' => action, 'controller' => controller) %]

-- cgit v1.2.3-54-g00ecf