[Bast-commits] r9060 - in DBIx-Class/0.08/trunk:
lib/DBIx/Class/Storage t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Fri Mar 26 14:28:24 GMT 2010
Author: caelum
Date: 2010-03-26 14:28:24 +0000 (Fri, 26 Mar 2010)
New Revision: 9060
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/trunk/t/748informix.t
DBIx-Class/0.08/trunk/t/749sybase_asa.t
DBIx-Class/0.08/trunk/t/750firebird.t
Log:
minor cleanups
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-03-26 14:08:16 UTC (rev 9059)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-03-26 14:28:24 UTC (rev 9060)
@@ -938,7 +938,11 @@
my $self = shift;
my %info;
- my $dbms_ver = eval { local $@; $self->_get_dbh->get_info(18) };
+ my $dbms_ver = eval {
+ local $@;
+ $SIG{__WARN__} = sub {};
+ $self->_get_dbh->get_info(18)
+ };
if (defined $dbms_ver) {
$info{dbms_ver} = $dbms_ver;
Modified: DBIx-Class/0.08/trunk/t/748informix.t
===================================================================
--- DBIx-Class/0.08/trunk/t/748informix.t 2010-03-26 14:08:16 UTC (rev 9059)
+++ DBIx-Class/0.08/trunk/t/748informix.t 2010-03-26 14:28:24 UTC (rev 9060)
@@ -97,7 +97,7 @@
is( $lim->next, undef, "next past end of resultset ok" );
# test savepoints
-eval {
+throws_ok {
$schema->txn_do(sub {
eval {
$schema->txn_do(sub {
@@ -110,9 +110,7 @@
$ars->create({ name => 'in_outer_txn' });
die "rolling back outer txn";
});
-};
-
-like $@, qr/rolling back outer txn/,
+} qr/rolling back outer txn/,
'correct exception for rollback';
ok ((not $ars->search({ name => 'in_outer_txn' })->first),
Modified: DBIx-Class/0.08/trunk/t/749sybase_asa.t
===================================================================
--- DBIx-Class/0.08/trunk/t/749sybase_asa.t 2010-03-26 14:08:16 UTC (rev 9059)
+++ DBIx-Class/0.08/trunk/t/749sybase_asa.t 2010-03-26 14:28:24 UTC (rev 9060)
@@ -61,7 +61,7 @@
is($new->artistid, 66, 'Explicit PK assigned');
# test savepoints
- eval {
+ throws_ok {
$schema->txn_do(sub {
eval {
$schema->txn_do(sub {
@@ -74,9 +74,7 @@
$ars->create({ name => 'in_outer_txn' });
die "rolling back outer txn";
});
- };
-
- like $@, qr/rolling back outer txn/,
+ } qr/rolling back outer txn/,
'correct exception for rollback';
ok ((not $ars->search({ name => 'in_outer_txn' })->first),
Modified: DBIx-Class/0.08/trunk/t/750firebird.t
===================================================================
--- DBIx-Class/0.08/trunk/t/750firebird.t 2010-03-26 14:08:16 UTC (rev 9059)
+++ DBIx-Class/0.08/trunk/t/750firebird.t 2010-03-26 14:28:24 UTC (rev 9060)
@@ -101,7 +101,7 @@
is($st->pkid1, 55, "Firebird Auto-PK without trigger: First primary key set manually");
# test savepoints
- eval {
+ throws_ok {
$schema->txn_do(sub {
eval {
$schema->txn_do(sub {
@@ -114,9 +114,7 @@
$ars->create({ name => 'in_outer_txn' });
die "rolling back outer txn";
});
- };
-
- like $@, qr/rolling back outer txn/,
+ } qr/rolling back outer txn/,
'correct exception for rollback';
ok ((not $ars->search({ name => 'in_outer_txn' })->first),
@@ -184,13 +182,15 @@
is( eval { $lim->next->artistid }, 102, "iterator->next ok" );
is( $lim->next, undef, "next past end of resultset ok" );
-# test multiple executing cursors
+# test nested cursors
{
my $rs1 = $ars->search({}, { order_by => { -asc => 'artistid' }});
- my $rs2 = $ars->search({}, { order_by => { -desc => 'artistid' }});
- is $rs1->next->artistid, 1, 'multiple cursors';
- is $rs2->next->artistid, 102, 'multiple cursors';
+ my $rs2 = $ars->search({ artistid => $rs1->next->artistid }, {
+ order_by => { -desc => 'artistid' }
+ });
+
+ is $rs2->next->artistid, 1, 'nested cursors';
}
# test empty insert
More information about the Bast-commits
mailing list