[Bast-commits] r8480 - branches/DBIx-Class-Schema-Loader/current/t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Sat Jan 30 23:42:12 GMT 2010


Author: caelum
Date: 2010-01-30 23:42:11 +0000 (Sat, 30 Jan 2010)
New Revision: 8480

Modified:
   branches/DBIx-Class-Schema-Loader/current/t/15sybase_common.t
Log:
a couple more extra TODO tests for Sybase computed columns

Modified: branches/DBIx-Class-Schema-Loader/current/t/15sybase_common.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/15sybase_common.t	2010-01-30 23:25:47 UTC (rev 8479)
+++ branches/DBIx-Class-Schema-Loader/current/t/15sybase_common.t	2010-01-30 23:42:11 UTC (rev 8480)
@@ -2,6 +2,7 @@
 use lib qw(t/lib);
 use dbixcsl_common_tests;
 use Test::More;
+use Test::Exception;
 
 my $dsn      = $ENV{DBICTEST_SYBASE_DSN} || '';
 my $user     = $ENV{DBICTEST_SYBASE_USER} || '';
@@ -25,7 +26,7 @@
             },
         ],
         drop  => [ qw/ sybase_loader_test1 / ],
-        count => 7,
+        count => 9,
         run   => sub {
             my ($schema, $monikers, $classes) = @_;
 
@@ -55,7 +56,7 @@
             {
                 local $TODO = 'constant DEFAULT introspection';
 
-                is $rsrc->column_info('charfield')->{default},
+                is $rsrc->column_info('charfield')->{default_value},
                     'foo',
                     'constant DEFAULT is correct';
             }
@@ -70,6 +71,22 @@
             or diag "Data type is: ",
                 $rsrc->column_info('computed_dt')->{data_type}
             ;
+
+            {
+                local $TODO = 'default_value for computed columns';
+
+                my $computed_dt_default =
+                    $rsrc->column_info('computed_dt')->{default_value};
+
+                ok ((ref $computed_dt_default eq 'SCALAR'),
+                    'default_value for computed column is a scalar ref')
+#                or diag "default_value is: ", $computed_dt_default
+                ;
+
+                eval { is $$computed_dt_default,
+                    'getdate()',
+                    'default_value for computed column is correct' };
+            }
         },
     },
 );




More information about the Bast-commits mailing list