[Bast-commits] r5395 - in
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t: . lib var
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Mon Feb 2 13:49:35 GMT 2009
Author: zby
Date: 2009-02-02 13:49:35 +0000 (Mon, 02 Feb 2009)
New Revision: 5395
Modified:
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/pg.t
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/sqlite.t
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
Log:
a few tests
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm
===================================================================
--- DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm 2009-02-01 22:44:39 UTC (rev 5394)
+++ DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm 2009-02-02 13:49:35 UTC (rev 5395)
@@ -5,8 +5,11 @@
use strict;
use Test::More;
+
sub run_tests{
my $schema = shift;
+
+ plan tests => 24;
my $dvd_rs = $schema->resultset( 'Dvd' );
my $user_rs = $schema->resultset( 'User' );
@@ -23,19 +26,18 @@
id => undef,
name => 'Test name 2',
viewings => [ { user_id => $owner->id } ],
- owner => { id => $owner->id },
+ owner => { id => $another_owner->id },
};
my $new_dvd = $dvd_rs->recursive_update( $updates );
# my $new_dvd = $dvd_rs->create( $updates );
- ok ( $new_dvd->isa( 'DBSchema::Result::Dvd' ), 'Dvd created' );
is ( $dvd_rs->count, $initial_dvd_count + 1, 'Dvd created' );
is ( $schema->resultset( 'User' )->count, $initial_user_count, "No new user created" );
is ( $new_dvd->name, 'Test name 2', 'Dvd name set' );
- is ( $new_dvd->owner->id, $owner->id, 'Owner set' );
+ is ( $new_dvd->owner->id, $another_owner->id, 'Owner set' );
is ( $new_dvd->viewings->count, 1, 'Viewing created' );
-;
+
# creating new records
my $updates = {
id => undef,
@@ -112,6 +114,8 @@
};
my $user = $user_rs->recursive_update( $updates );
+ is ( $schema->resultset( 'User' )->count, $initial_user_count + 2, "New user created" );
+ is ( $dvd_rs->count, $initial_dvd_count + 4, 'Dvds created' );
my %owned_dvds = map { $_->name => $_ } $user->owned_dvds;
is( scalar keys %owned_dvds, 2, 'Has many relations created' );
ok( $owned_dvds{'temp name 1'}, 'Name in a has_many related record saved' );
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/pg.t
===================================================================
--- DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/pg.t 2009-02-01 22:44:39 UTC (rev 5394)
+++ DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/pg.t 2009-02-02 13:49:35 UTC (rev 5395)
@@ -10,8 +10,6 @@
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
. ' (note: creates and tables!)' unless ($dsn && $user);
-plan tests => 19;
-
my $schema = DBSchema::get_test_schema( $dsn, $user, $pass );
run_tests( $schema );
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/sqlite.t
===================================================================
--- DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/sqlite.t 2009-02-01 22:44:39 UTC (rev 5394)
+++ DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/sqlite.t 2009-02-02 13:49:35 UTC (rev 5395)
@@ -4,7 +4,6 @@
use DBSchema;
use RunTests;
use Test::More;
-plan tests => 23;
my $schema = DBSchema::get_test_schema();
run_tests( $schema );
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
===================================================================
(Binary files differ)
More information about the Bast-commits
mailing list