Changeset 9183

Show
Ignore:
Timestamp:
04/09/08 15:55:08 (5 years ago)
Author:
yappo
Message:

lang/perl/Class-Component: 複数回autoloadされた時のテストを追加

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Class-Component/trunk/t/16_myclass_autoload_plugin.t

    r9181 r9183  
    55use lib 't'; 
    66 
    7 use Test::More tests => 6; 
     7use Test::More tests => 24; 
    88 
    99use MyClass; 
     
    1313    $c->load_components('AutoloadPlugin'); 
    1414    is $c->call('hello'), undef; 
     15    is $c->run_hook('hello'), undef; 
     16 
    1517    $c->autoload_plugins({ module => 'Hello'}); # hashref. 
    1618    is $c->call('hello'), 'hello'; 
     19    is $c->run_hook('hello')->[0], 'hook hello'; 
     20    is scalar(@{ $c->run_hook('hello') }), 1; 
     21 
     22    $c->autoload_plugins({ module => 'Hello'}); # hashref. 
     23    is $c->call('hello'), 'hello'; 
     24    is $c->run_hook('hello')->[0], 'hook hello'; 
     25    is scalar(@{ $c->run_hook('hello') }), 1; 
    1726}; 
    1827 
     
    2130    $c->load_components('AutoloadPlugin'); 
    2231    is $c->call('hello'), undef; 
     32    is $c->run_hook('hello'), undef; 
     33 
    2334    $c->autoload_plugins('Hello'); # simple string 
    2435    is $c->call('hello'), 'hello'; 
     36    is $c->run_hook('hello')->[0], 'hook hello'; 
     37    is scalar(@{ $c->run_hook('hello') }), 1; 
     38 
     39    $c->autoload_plugins('Hello'); # simple string 
     40    is $c->call('hello'), 'hello'; 
     41    is $c->run_hook('hello')->[0], 'hook hello'; 
     42    is scalar(@{ $c->run_hook('hello') }), 1; 
    2543}; 
    2644 
     
    2947    $c->load_components('AutoloadPlugin'); 
    3048    is $c->call('hello'), undef; 
     49    is $c->run_hook('hello'), undef; 
     50 
    3151    $c->autoload_plugins('+MyClass::Plugin::Hello'); # full path 
    3252    is $c->call('hello'), 'hello'; 
     53    is $c->run_hook('hello')->[0], 'hook hello'; 
     54    is scalar(@{ $c->run_hook('hello') }), 1; 
     55 
     56    $c->autoload_plugins('+MyClass::Plugin::Hello'); # full path 
     57    is $c->call('hello'), 'hello'; 
     58    is $c->run_hook('hello')->[0], 'hook hello'; 
     59    is scalar(@{ $c->run_hook('hello') }), 1; 
    3360}; 
    3461