Changeset 18018

Show
Ignore:
Timestamp:
08/22/08 06:50:54 (5 months ago)
Author:
tokuhirom
Message:

refactoring

Location:
lang/perl/Nanto/trunk/t
Files:
4 modified
2 moved

Legend:

Unmodified
Added
Removed
  • lang/perl/Nanto/trunk/t/020_web/Handler.t

    r18016 r18018  
    44use Test::More; 
    55 
    6 plan tests => 6; 
     6plan tests => 7; 
    77 
    88# 404 
     
    4747}; 
    4848 
     49# dispatcher 
     50do { 
     51    my $res = run_engine( 
     52        'GET', '/dispatcher' 
     53    ); 
     54    is $res->content, 'Foo::Web::Dispatcher'; 
     55}; 
     56 
  • lang/perl/Nanto/trunk/t/Utils.pm

    r18008 r18018  
    1818 
    1919sub loader { 
    20     Nanto::ClassLoader->new(base => 't'); 
     20    Nanto::ClassLoader->new(base => 'Foo'); 
    2121} 
    2222 
  • lang/perl/Nanto/trunk/t/lib/Foo/Web/C/Foo.pm

    r18016 r18018  
    1 package t::Web::C::Foo; 
     1package Foo::Web::C::Foo; 
    22use Nanto::Web::C; 
    33 
     
    3535}; 
    3636 
     37on 'dispatcher' => { 
     38    GET => sub { 
     39        res( 
     40            status => 200, 
     41            body   => dispatcher(), 
     42        ); 
     43    }, 
     44}; 
     45 
    37461; 
  • lang/perl/Nanto/trunk/t/lib/Foo/Web/Dispatcher.pm

    r18016 r18018  
    99connect 'invalid_object',  {controller => 'Foo', action => 'invalid_object', args => {} }; 
    1010connect 'redirect',  {controller => 'Foo', action => 'redirect', args => {} }; 
     11connect 'dispatcher',  {controller => 'Foo', action => 'dispatcher', args => {} }; 
    1112 
    12131;