[Bast-commits] r8442 - DBIx-Class-Journal/1.000/trunk/t

frew at dev.catalyst.perl.org frew at dev.catalyst.perl.org
Wed Jan 27 07:27:56 GMT 2010


Author: frew
Date: 2010-01-27 07:27:56 +0000 (Wed, 27 Jan 2010)
New Revision: 8442

Modified:
   DBIx-Class-Journal/1.000/trunk/t/01test.t
   DBIx-Class-Journal/1.000/trunk/t/02noautodeploy.t
Log:
fewer mega long lines

Modified: DBIx-Class-Journal/1.000/trunk/t/01test.t
===================================================================
--- DBIx-Class-Journal/1.000/trunk/t/01test.t	2010-01-27 07:08:58 UTC (rev 8441)
+++ DBIx-Class-Journal/1.000/trunk/t/01test.t	2010-01-27 07:27:56 UTC (rev 8442)
@@ -15,21 +15,40 @@
 my $schema = DBICTest->init_schema(no_populate => 1);
 
 ok($schema, 'Created a Schema');
-isa_ok($schema->_journal_schema, 'DBIx::Class::Schema::Journal::DB', 'Actually have a schema object for the journaling');
-isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists');
-isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists');
 
+isa_ok(
+   $schema->_journal_schema,
+   'DBIx::Class::Schema::Journal::DB',
+   'Actually have a schema object for the journaling'
+);
+
+isa_ok(
+   $schema->_journal_schema->source('CDAuditHistory'),
+   'DBIx::Class::ResultSource',
+   'CDAuditHistory source exists'
+);
+
+isa_ok(
+   $schema->_journal_schema->source('ArtistAuditLog'),
+   'DBIx::Class::ResultSource',
+   'ArtistAuditLog source exists'
+);
+
 my $artist;
 my $new_cd = $schema->txn_do( sub {
     my $current_changeset = $schema->_journal_schema->_current_changeset;
-    ok( $current_changeset, "have a current changeset" );
+    ok( $current_changeset, 'have a current changeset' );
 
     $artist = $schema->resultset('Artist')->create({
         name => 'Fred Bloggs',
     });
 
     $schema->txn_do(sub {
-        is( $current_changeset, $schema->_journal_schema->_current_changeset, "nested txn doesn't create a new changeset" );
+        is(
+           $current_changeset,
+           $schema->_journal_schema->_current_changeset,
+           q{nested txn doesn't create a new changeset}
+        );
         return $schema->resultset('CD')->create({
             title => 'Angry young man',
             artist => $artist,
@@ -37,22 +56,29 @@
         });
     });
 });
-isa_ok($new_cd, 'DBIx::Class::Journal', 'Created CD object');
+isa_ok(
+   $new_cd,
+   'DBIx::Class::Journal',
+   'Created CD object'
+);
 
-is( $schema->_journal_schema->_current_changeset, undef, "no current changeset" );
+is(
+   $schema->_journal_schema->_current_changeset,
+   undef, 'no current changeset'
+);
 eval { $schema->_journal_schema->current_changeset };
-ok( $@, "causes error" );
+ok( $@, 'causes error' );
 
-my $search = $schema->_journal_schema->resultset('CDAuditLog')->search();
+my $search = $schema->_journal_schema->resultset('CDAuditLog')->search;
 ok($search->count, 'Created an entry in the CD audit log');
 
-$schema->txn_do( sub {
+$schema->txn_do(sub {
     $new_cd->year(2003);
     $new_cd->update;
-} );
+});
 
 is($new_cd->year, 2003,  'Changed year to 2003');
-my $cdah = $schema->_journal_schema->resultset('CDAuditHistory')->search();
+my $cdah = $schema->_journal_schema->resultset('CDAuditHistory')->search;
 ok($cdah->count, 'Created an entry in the CD audit history');
 
 $schema->txn_do( sub {
@@ -61,7 +87,7 @@
         artist => $artist,
         year => 1999,
     });
-} );
+});
 
 
 my %id = map { $_ => $new_cd->get_column($_) } $new_cd->primary_columns;
@@ -72,9 +98,12 @@
 
 {
     my $alentry = $search->find(\%id);
-    ok($alentry, "got log entry");
+    ok($alentry, 'got log entry');
     ok(defined($alentry->deleted), 'Deleted set in audit_log');
-    cmp_ok( $alentry->deleted->id, ">", $alentry->created->id, "deleted is after created" );
+    cmp_ok(
+       $alentry->deleted->id, '>', $alentry->created->id,
+       'deleted is after created'
+    );
 }
 
 $new_cd = $schema->txn_do( sub {
@@ -88,9 +117,12 @@
 
 {
     my $alentry = $search->find(\%id);
-    ok($alentry, "got log entry");
+    ok($alentry, 'got log entry');
     ok(defined($alentry->deleted), 'Deleted set in audit_log');
-    cmp_ok( $alentry->deleted->id, "<", $alentry->created->id, "deleted is before created (recreated)" );
+    cmp_ok(
+       $alentry->deleted->id, '<', $alentry->created->id,
+       'deleted is before created (recreated)'
+    );
 }
 
 $schema->changeset_user(1);

Modified: DBIx-Class-Journal/1.000/trunk/t/02noautodeploy.t
===================================================================
--- DBIx-Class-Journal/1.000/trunk/t/02noautodeploy.t	2010-01-27 07:08:58 UTC (rev 8441)
+++ DBIx-Class-Journal/1.000/trunk/t/02noautodeploy.t	2010-01-27 07:27:56 UTC (rev 8442)
@@ -15,17 +15,29 @@
 my $schema = DBICTest->init_schema(no_populate => 1, no_deploy => 1);
 
 ok($schema, 'Created a Schema');
-isa_ok($schema->_journal_schema, 'DBIx::Class::Schema::Journal::DB', 'Actually have a schema object for the journaling');
-isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists');
-isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists');
+isa_ok(
+	$schema->_journal_schema,
+	'DBIx::Class::Schema::Journal::DB',
+	'Actually have a schema object for the journaling'
+);
+isa_ok(
+	$schema->_journal_schema->source('CDAuditHistory'),
+	'DBIx::Class::ResultSource',
+	'CDAuditHistory source exists'
+);
+isa_ok(
+	$schema->_journal_schema->source('ArtistAuditLog'),
+	'DBIx::Class::ResultSource',
+	'ArtistAuditLog source exists'
+);
 
 my $count = eval {
     $schema->_journal_schema->resultset('ChangeLog')->count;
 };
 my $e = $@;
 
-is( $count, undef, "no count" );
-like( $e, qr/table.*changelog/, "missing table error" );
+is( $count, undef, 'no count' );
+like( $e, qr/table.*changelog/, 'missing table error' );
 
 $schema->journal_schema_deploy();
 




More information about the Bast-commits mailing list