Show
Ignore:
Timestamp:
11/27/08 14:39:03 (6 years ago)
Author:
tokuhirom
Message:

handles に scalar もわたせるようにした

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Shika/trunk/t/010_core/04_handles.t

    r25058 r25088  
    11use strict; 
    22use warnings; 
    3 use Test::More tests => 1; 
     3use Test::More tests => 2; 
    44 
    55{ 
     
    1414 
    1515{ 
    16     package Foo; 
     16    package Foo1; 
    1717    use Shika; 
    1818    has bar => ( 
     
    2121} 
    2222 
    23 my $f = Foo->new(bar => Bar->new()); 
    24 is $f->yay('hoge', 'fuga'), 'yay hoge, fuga'; 
     23{ 
     24    package Foo2; 
     25    use Shika; 
     26    has bar => ( 
     27        handles => 'yay', 
     28    ); 
     29} 
    2530 
     31{ 
     32    my $f = Foo1->new(bar => Bar->new()); 
     33    is $f->yay('hoge', 'fuga'), 'yay hoge, fuga'; 
     34} 
     35 
     36{ 
     37    my $f = Foo2->new(bar => Bar->new()); 
     38    is $f->yay('hoge', 'fuga'), 'yay hoge, fuga'; 
     39} 
     40