[Bast-commits] r4549 - DBIx-Class-DynamicDefault/1.000/trunk/t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Tue Jul 1 13:21:26 BST 2008
Author: rafl
Date: 2008-07-01 13:21:24 +0100 (Tue, 01 Jul 2008)
New Revision: 4549
Modified:
DBIx-Class-DynamicDefault/1.000/trunk/t/basic.t
Log:
Test behaviour when columns with default values are set explicitly.
Modified: DBIx-Class-DynamicDefault/1.000/trunk/t/basic.t
===================================================================
--- DBIx-Class-DynamicDefault/1.000/trunk/t/basic.t 2008-07-01 12:21:16 UTC (rev 4548)
+++ DBIx-Class-DynamicDefault/1.000/trunk/t/basic.t 2008-07-01 12:21:24 UTC (rev 4549)
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More tests => 9;
use DBICx::TestDatabase;
BEGIN { use_ok('DBIx::Class::DynamicDefault') }
@@ -22,3 +22,12 @@
is($row->quux, 1, 'no default on update');
is($row->garply, $$, 'default on update with coderef');
is($row->corge, 'update', 'default on update with methodname');
+
+$row->garply(-42);
+$row->update;
+
+is($row->garply, -42, 'defaults don\'t get set when a value is specified explicitly on update');
+
+$row = $rs->create({ quux => -23 });
+
+is($row->quux, -23, 'defaults don\'t get set when a value is specified explicitly on create');
More information about the Bast-commits
mailing list