[Bast-commits] r5034 - in DBIx-Class/0.08/trunk: . t t/cdbi-t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Fri Oct 31 20:34:27 GMT 2008


Author: ribasushi
Date: 2008-10-31 20:34:27 +0000 (Fri, 31 Oct 2008)
New Revision: 5034

Added:
   DBIx-Class/0.08/trunk/t/cdbi-t/68-inflate_has_a.t
Removed:
   DBIx-Class/0.08/trunk/t/68inflate_has_a.t
Modified:
   DBIx-Class/0.08/trunk/Makefile.PL
Log:
68inflate_has_a.t tests the cdbi-compat shim and thus belongs in t/cdbi-t
bumped up the version of DBD::SQLite required for testing

Modified: DBIx-Class/0.08/trunk/Makefile.PL
===================================================================
--- DBIx-Class/0.08/trunk/Makefile.PL	2008-10-31 11:22:38 UTC (rev 5033)
+++ DBIx-Class/0.08/trunk/Makefile.PL	2008-10-31 20:34:27 UTC (rev 5034)
@@ -29,7 +29,7 @@
 # Perl 5.8.0 doesn't have utf8::is_utf8()
 requires 'Encode'                    => 0 if ($] <= 5.008000);  
 
-test_requires 'DBD::SQLite'         => 1.13;
+test_requires 'DBD::SQLite'         => 1.14;
 test_requires 'Test::Builder'       => 0.33;
 test_requires 'Test::Warn'          => 0.11;
 test_requires 'Test::Exception'     => 0;

Deleted: DBIx-Class/0.08/trunk/t/68inflate_has_a.t
===================================================================
--- DBIx-Class/0.08/trunk/t/68inflate_has_a.t	2008-10-31 11:22:38 UTC (rev 5033)
+++ DBIx-Class/0.08/trunk/t/68inflate_has_a.t	2008-10-31 20:34:27 UTC (rev 5034)
@@ -1,61 +0,0 @@
-use strict;
-use warnings;  
-
-use Test::More;
-use lib qw(t/lib);
-use DBICTest;
-
-my $schema = DBICTest->init_schema();
-
-eval { require DateTime };
-plan skip_all => "Need DateTime for inflation tests" if $@;
-
-eval { require Clone };
-plan skip_all => "Need Clone for CDBICompat inflation tests" if $@;
-
-plan tests => 6;
-
-DBICTest::Schema::CD->load_components(qw/CDBICompat::Relationships/);
-
-DBICTest::Schema::CD->has_a( 'year', 'DateTime',
-      inflate => sub { DateTime->new( year => shift ) },
-      deflate => sub { shift->year }
-);
-Class::C3->reinitialize;
-
-# inflation test
-my $cd = $schema->resultset("CD")->find(3);
-
-is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
-
-is( $cd->year->month, 1, 'inflated month ok' );
-
-# deflate test
-my $now = DateTime->now;
-$cd->year( $now );
-$cd->update;
-
-($cd) = $schema->resultset("CD")->search( year => $now->year );
-is( $cd->year->year, $now->year, 'deflate ok' );
-
-# re-test using alternate deflate syntax
-$schema->class("CD")->has_a( 'year', 'DateTime',
-      inflate => sub { DateTime->new( year => shift ) },
-      deflate => 'year'
-);
-
-# inflation test
-$cd = $schema->resultset("CD")->find(3);
-
-is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
-
-is( $cd->year->month, 1, 'inflated month ok' );
-
-# deflate test
-$now = DateTime->now;
-$cd->year( $now );
-$cd->update;
-
-($cd) = $schema->resultset("CD")->search( year => $now->year );
-is( $cd->year->year, $now->year, 'deflate ok' );
-

Copied: DBIx-Class/0.08/trunk/t/cdbi-t/68-inflate_has_a.t (from rev 5033, DBIx-Class/0.08/trunk/t/68inflate_has_a.t)
===================================================================
--- DBIx-Class/0.08/trunk/t/cdbi-t/68-inflate_has_a.t	                        (rev 0)
+++ DBIx-Class/0.08/trunk/t/cdbi-t/68-inflate_has_a.t	2008-10-31 20:34:27 UTC (rev 5034)
@@ -0,0 +1,67 @@
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+  eval "use DBIx::Class::CDBICompat;";
+  plan skip_all => "Class::Trigger and DBIx::ContextualFetch required"
+    if $@;
+
+  eval { require DateTime };
+  plan skip_all => "Need DateTime for inflation tests" if $@;
+
+  eval { require Clone };
+  plan skip_all => "Need Clone for CDBICompat inflation tests" if $@;
+}
+
+plan tests => 6;
+
+use lib qw(t/lib);
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+DBICTest::Schema::CD->load_components(qw/CDBICompat::Relationships/);
+
+DBICTest::Schema::CD->has_a( 'year', 'DateTime',
+      inflate => sub { DateTime->new( year => shift ) },
+      deflate => sub { shift->year }
+);
+Class::C3->reinitialize;
+
+# inflation test
+my $cd = $schema->resultset("CD")->find(3);
+
+is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
+
+is( $cd->year->month, 1, 'inflated month ok' );
+
+# deflate test
+my $now = DateTime->now;
+$cd->year( $now );
+$cd->update;
+
+($cd) = $schema->resultset("CD")->search( year => $now->year );
+is( $cd->year->year, $now->year, 'deflate ok' );
+
+# re-test using alternate deflate syntax
+$schema->class("CD")->has_a( 'year', 'DateTime',
+      inflate => sub { DateTime->new( year => shift ) },
+      deflate => 'year'
+);
+
+# inflation test
+$cd = $schema->resultset("CD")->find(3);
+
+is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
+
+is( $cd->year->month, 1, 'inflated month ok' );
+
+# deflate test
+$now = DateTime->now;
+$cd->year( $now );
+$cd->update;
+
+($cd) = $schema->resultset("CD")->search( year => $now->year );
+is( $cd->year->year, $now->year, 'deflate ok' );
+


Property changes on: DBIx-Class/0.08/trunk/t/cdbi-t/68-inflate_has_a.t
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the Bast-commits mailing list