Readey for release!
David Wheeler
21 years ago
0 | 0 |
#!/usr/bin/perl -w
|
1 | 1 |
|
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 $
|
3 | 3 |
|
4 | 4 |
use strict;
|
5 | 5 |
use Test::More (tests => 14);
|
|
17 | 17 |
ok( my $err = $@, "Catch exception" );
|
18 | 18 |
SKIP: {
|
19 | 19 |
# 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
|
21 | 21 |
unless ref $@;
|
22 | 22 |
isa_ok( $err, 'Exception::Class::DBI' );
|
23 | 23 |
like( $err->error, qr{Can't connect\(dbi:Bogus HASH\([^\)]+\)\), no database driver specified and DBI_DSN env var not set},
|
0 | 0 |
#!/usr/bin/perl -w
|
1 | 1 |
|
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 $
|
3 | 3 |
|
4 | 4 |
use strict;
|
5 | 5 |
use Test::More (tests => 35);
|
6 | 6 |
BEGIN { use_ok('Exception::Class::DBI') }
|
|
7 |
# Use PurePerl to get around CursorName bug.
|
7 | 8 |
BEGIN { $ENV{DBI_PUREPERL} = 2 }
|
8 | 9 |
use DBI;
|
9 | 10 |
|
10 | 11 |
ok( my $dbh = DBI->connect('dbi:ExampleP:dummy', '', '',
|
11 | |
#ok( my $dbh = DBI->connect('dbi:Pg:dbname=template1', 'postgres', '',
|
12 | 12 |
{ PrintError => 0,
|
13 | 13 |
RaiseError => 0,
|
14 | 14 |
HandleError => Exception::Class::DBI->handler
|
|
48 | 48 |
ok( ! $err->inactive_destroy, 'Check inactive_destroy' );
|
49 | 49 |
|
50 | 50 |
{
|
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.
|
52 | 53 |
local $^W;
|
53 | 54 |
ok( $err->trace_level == 0, 'Check trace_level' );
|
54 | 55 |
}
|