t/008_db_connect_cached.t
raw| 1 | use 5.008; |
| 2 | |
| 3 | use strict; |
| 4 | use warnings; |
| 5 | |
| 6 | use Test::More; |
| 7 | |
| 8 | BEGIN { |
| 9 | use_ok('DBD::Mock'); |
| 10 | use_ok('DBI'); |
| 11 | } |
| 12 | |
| 13 | # test that connect cached works as expected. |
| 14 | |
| 15 | { |
| 16 | my $dbh = DBI->connect_cached('DBI:Mock:', 'user', 'pass'); |
| 17 | isa_ok($dbh, 'DBI::db'); |
| 18 | |
| 19 | my $dbh2 = DBI->connect_cached('DBI:Mock:', 'user', 'pass'); |
| 20 | isa_ok($dbh2, 'DBI::db'); |
| 21 | |
| 22 | is($dbh, $dbh2, '.. these should be the same handles'); |
| 23 | } |
| 24 | |
| 25 | done_testing(); |