| 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 | }; |