Changeset 18468 for lang

Show
Ignore:
Timestamp:
08/30/08 12:18:05 (3 months ago)
Author:
tokuhirom
Message:

r24238@skinny: tokuhirom | 2008-08-30 11:32:04 +0900
test multiple dbhs

Location:
lang/perl/TheSchwartz-Simple/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/TheSchwartz-Simple/trunk

  • lang/perl/TheSchwartz-Simple/trunk/t/01_funcname_to_id.t

    r18453 r18468  
    44use TheSchwartz::Simple; 
    55 
    6 plan tests => 5; 
     6plan tests => 6; 
    77 
    88run_test { 
    9     my $dbh = shift; 
    10     my $sch = TheSchwartz::Simple->new($dbh); 
    11     isa_ok $sch, 'TheSchwartz::Simple'; 
    12     is $sch->funcname_to_id($dbh, 'foo'), 1; 
    13     is $sch->funcname_to_id($dbh, 'bar'), 2; 
    14     is $sch->funcname_to_id($dbh, 'foo'), 1; 
    15     is $sch->funcname_to_id($dbh, 'baz'), 3; 
     9    my $dbh1 = shift; 
     10    run_test { 
     11        my $dbh2 = shift; 
     12 
     13        my $sch = TheSchwartz::Simple->new([$dbh1, $dbh2]); 
     14        isa_ok $sch, 'TheSchwartz::Simple'; 
     15        is $sch->funcname_to_id($dbh1, 'foo'), 1; 
     16        is $sch->funcname_to_id($dbh1, 'bar'), 2; 
     17        is $sch->funcname_to_id($dbh1, 'foo'), 1; 
     18        is $sch->funcname_to_id($dbh1, 'baz'), 3; 
     19        is $sch->funcname_to_id($dbh2, 'bar'), 1, 'other dbh'; 
     20    }; 
    1621}; 
    1722