Changeset 18015

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

added more test cases

Location:
lang/perl/Nanto/trunk/t
Files:
3 modified

Legend:

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

    r18014 r18015  
    44use Test::More; 
    55 
    6 plan tests => 3; 
     6plan tests => 5; 
    77 
    88# 404 
     
    2222    is $res->code, 500; 
    2323}; 
     24 
     25# 500(but, no response) 
     26do { 
     27    my $res = run_engine( 
     28        'GET', '/no_response' 
     29    ); 
     30    is $res->code, 500, 'no response'; 
     31}; 
     32 
     33# 500(but, invalid object) 
     34do { 
     35    my $res = run_engine( 
     36        'GET', '/invalid_object' 
     37    ); 
     38    is $res->code, 500, 'invalid object'; 
     39}; 
     40 
  • lang/perl/Nanto/trunk/t/Web/C/Foo.pm

    r18014 r18015  
    1919}; 
    2020 
     21on 'no_response' => { 
     22    GET => sub { }, 
     23}; 
     24 
     25on 'invalid_object' => { 
     26    GET => sub { 
     27        return bless {}, 'ThisIsInvalid' 
     28    }, 
     29}; 
     30 
    21311; 
  • lang/perl/Nanto/trunk/t/lib/Foo/Web/Dispatcher.pm

    r18014 r18015  
    66connect '',  {controller => 'Foo', action => 'simple_html', args => {} }; 
    77connect 'die',  {controller => 'Foo', action => 'die', args => {} }; 
     8connect 'no_response',  {controller => 'Foo', action => 'no_response', args => {} }; 
     9connect 'invalid_object',  {controller => 'Foo', action => 'invalid_object', args => {} }; 
    810 
    9111;