[Bast-commits] r6116 - in
DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t: .
resultset
plu at dev.catalyst.perl.org
plu at dev.catalyst.perl.org
Sun May 3 09:13:48 GMT 2009
Author: plu
Date: 2009-05-03 09:13:48 +0000 (Sun, 03 May 2009)
New Revision: 6116
Modified:
DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/53delete_chained.t
DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/76joins.t
DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/resultset/as_query.t
Log:
Using "is" instead of "cmp_ok"
Modified: DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/53delete_chained.t
===================================================================
--- DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/53delete_chained.t 2009-05-03 08:52:07 UTC (rev 6115)
+++ DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/53delete_chained.t 2009-05-03 09:13:48 UTC (rev 6116)
@@ -28,7 +28,7 @@
my $rs = $artist->cds->search_related('tracks');
$total_tracks -= $rs->count;
ok($rs->delete);
- cmp_ok($schema->resultset('Track')->count, '==', $total_tracks, '3 tracks should be deleted');
+ is($schema->resultset('Track')->count, $total_tracks, '3 tracks should be deleted');
}
# test that delete_related w/conditions deletes just the matched related records only
@@ -43,5 +43,5 @@
my $rs = $artist2->search_related('cds')->search_related('tracks');
$total_tracks -= $rs->count;
ok($rs->delete);
- cmp_ok($schema->resultset('Track')->count, '==', $total_tracks, 'No tracks should be deleted');
+ is($schema->resultset('Track')->count, $total_tracks, 'No tracks should be deleted');
}
Modified: DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/76joins.t
===================================================================
--- DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/76joins.t 2009-05-03 08:52:07 UTC (rev 6115)
+++ DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/76joins.t 2009-05-03 09:13:48 UTC (rev 6116)
@@ -140,7 +140,7 @@
] ] }
);
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Forkful of bees', 'Correct record returned');
@@ -148,7 +148,7 @@
{ 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
{ join => 'artist' });
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Forkful of bees', 'Correct record returned');
@@ -157,7 +157,7 @@
'liner_notes.notes' => 'Kill Yourself!' },
{ join => [ qw/artist liner_notes/ ] });
-cmp_ok( $rs + 0, '==', 1, "Single record in resultset");
+is( $rs + 0, 1, "Single record in resultset");
is($rs->first->title, 'Come Be Depressed With Us', 'Correct record returned');
@@ -166,7 +166,7 @@
{ 'artist' => 1 },
{ join => [qw/artist/], order_by => 'artist.name' }
);
-cmp_ok( scalar $rs->all, '==', scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' );
+is( scalar $rs->all, scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' );
ok(!$rs->slice($rs->count+1000, $rs->count+1002)->count,
'Slicing beyond end of rs returns a zero count');
@@ -175,7 +175,7 @@
{ 'liner_notes.notes' => 'Kill Yourself!' },
{ join => { 'cds' => 'liner_notes' } });
-cmp_ok( $rs->count, '==', 1, "Single record in resultset");
+is( $rs->count, 1, "Single record in resultset");
is($rs->first->name, 'We Are Goth', 'Correct record returned');
@@ -206,8 +206,8 @@
return $schema->resultset("TwoKeys")->count;
}
- cmp_ok(cd_count(), '==', 8, '8 rows in table cd');
- cmp_ok(tk_count(), '==', 7, '7 rows in table twokeys');
+ is(cd_count(), 8, '8 rows in table cd');
+ is(tk_count(), 7, '7 rows in table twokeys');
sub artist1 {
return $schema->resultset("CD")->search(
@@ -222,13 +222,13 @@
);
}
- cmp_ok( artist1()->count, '==', 3, '3 Caterwauler McCrae CDs' );
+ is( artist1()->count, 3, '3 Caterwauler McCrae CDs' );
ok( artist1()->delete, 'Successfully deleted 3 CDs' );
- cmp_ok( artist1()->count, '==', 0, '0 Caterwauler McCrae CDs' );
- cmp_ok( artist2()->count, '==', 2, '3 Random Boy Band CDs' );
+ is( artist1()->count, 0, '0 Caterwauler McCrae CDs' );
+ is( artist2()->count, 2, '3 Random Boy Band CDs' );
ok( artist2()->update( { 'artist' => 1 } ) );
- cmp_ok( artist2()->count, '==', 0, '0 Random Boy Band CDs' );
- cmp_ok( artist1()->count, '==', 2, '2 Caterwauler McCrae CDs' );
+ is( artist2()->count, 0, '0 Random Boy Band CDs' );
+ is( artist1()->count, 2, '2 Caterwauler McCrae CDs' );
# test update on multi-column-pk
sub tk1 {
@@ -246,12 +246,12 @@
{ join => [qw/artist/]}
);
}
- cmp_ok( tk2()->count, '==', 2, 'TwoKeys count == 2' );
- cmp_ok( tk1()->count, '==', 2, 'TwoKeys count == 2' );
+ is( tk2()->count, 2, 'TwoKeys count == 2' );
+ is( tk1()->count, 2, 'TwoKeys count == 2' );
ok( tk1()->update( { artist => 1 } ) );
- cmp_ok( tk1()->count, '==', 0, 'TwoKeys count == 0' );
- cmp_ok( tk2()->count, '==', 4, '2 Caterwauler McCrae CDs' );
+ is( tk1()->count, 0, 'TwoKeys count == 0' );
+ is( tk2()->count, 4, '2 Caterwauler McCrae CDs' );
ok( tk2()->delete, 'Successfully deleted 4 CDs' );
- cmp_ok(cd_count(), '==', 5, '5 rows in table cd');
- cmp_ok(tk_count(), '==', 3, '3 rows in table twokeys');
+ is(cd_count(), 5, '5 rows in table cd');
+ is(tk_count(), 3, '3 rows in table twokeys');
}
Modified: DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/resultset/as_query.t
===================================================================
--- DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/resultset/as_query.t 2009-05-03 08:52:07 UTC (rev 6115)
+++ DBIx-Class/0.08/branches/fix-update-and-delete-as_query/t/resultset/as_query.t 2009-05-03 09:13:48 UTC (rev 6116)
@@ -79,7 +79,7 @@
[['artist.name' => 'Caterwauler McCrae']]
);
my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $query } } );
- cmp_ok($subsel_rs->count, '==', $rs->count, 'Subselect on PK got the same row count');
+ is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
}
__END__
More information about the Bast-commits
mailing list