Codebase list libexception-class-dbi-perl / 7aa90b7
Readey for release! David Wheeler 21 years ago
2 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
00 #!/usr/bin/perl -w
11
2 # $Id: dbi.t,v 1.2 2002/08/23 00:55:45 david Exp $
2 # $Id: dbi.t,v 1.3 2002/08/23 19:24:53 david Exp $
33
44 use strict;
55 use Test::More (tests => 14);
1717 ok( my $err = $@, "Catch exception" );
1818 SKIP: {
1919 # Remove this skip when DBI->connect uses exceptions.
20 skip 'HandleError not logic not yet used by DBI->connect', 6
20 skip 'HandleError not logic not yet used by DBI->connect', 12
2121 unless ref $@;
2222 isa_ok( $err, 'Exception::Class::DBI' );
2323 like( $err->error, qr{Can't connect\(dbi:Bogus HASH\([^\)]+\)\), no database driver specified and DBI_DSN env var not set},
00 #!/usr/bin/perl -w
11
2 # $Id: sth.t,v 1.5 2002/08/23 18:27:36 david Exp $
2 # $Id: sth.t,v 1.6 2002/08/23 19:24:53 david Exp $
33
44 use strict;
55 use Test::More (tests => 35);
66 BEGIN { use_ok('Exception::Class::DBI') }
7 # Use PurePerl to get around CursorName bug.
78 BEGIN { $ENV{DBI_PUREPERL} = 2 }
89 use DBI;
910
1011 ok( my $dbh = DBI->connect('dbi:ExampleP:dummy', '', '',
11 #ok( my $dbh = DBI->connect('dbi:Pg:dbname=template1', 'postgres', '',
1212 { PrintError => 0,
1313 RaiseError => 0,
1414 HandleError => Exception::Class::DBI->handler
4848 ok( ! $err->inactive_destroy, 'Check inactive_destroy' );
4949
5050 {
51 # PurePerl->{TraceLevel} should return an integer, but it doesn't.
51 # PurePerl->{TraceLevel} should return an integer, but it doesn't. It
52 # returns undef instead.
5253 local $^W;
5354 ok( $err->trace_level == 0, 'Check trace_level' );
5455 }