Changeset 33455 for lang/perl/Data-Model

Show
Ignore:
Timestamp:
05/20/09 18:59:34 (4 years ago)
Author:
yappo
Message:

accept dbh option by t::Utils::(?:setup|teardown)_schema methods

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Data-Model/trunk/t/Utils.pm

    r32398 r33455  
    177177sub setup_schema { 
    178178    my($dsn, @sqls) = @_; 
    179     my $dbh = DBI->connect($dsn, 
     179    my $dbh = ref($dsn) eq 'DBI::db' ? $dsn : DBI->connect($dsn, 
    180180                           '', '', { RaiseError => 1, PrintError => 0 }); 
    181181    for my $sql (@sqls) { 
     
    187187sub teardown_schema { 
    188188    my($dsn, @tables) = @_; 
    189     my $dbh = DBI->connect($dsn, 
     189    my $dbh = ref($dsn) eq 'DBI::db' ? $dsn : DBI->connect($dsn, 
    190190                           '', '', { RaiseError => 1, PrintError => 0 }); 
    191191    for my $table (@tables) {