[Jifty-commit] r2824 - in Jifty-DBI: trunk/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Feb 23 09:59:13 EST 2007


Author: sterling
Date: Fri Feb 23 09:59:08 2007
New Revision: 2824

Modified:
   Jifty-DBI/   (props changed)
   Jifty-DBI/trunk/t/01records.t

Log:
added a simple test for as_hash

Modified: Jifty-DBI/trunk/t/01records.t
==============================================================================
--- Jifty-DBI/trunk/t/01records.t	(original)
+++ Jifty-DBI/trunk/t/01records.t	Fri Feb 23 09:59:08 2007
@@ -8,7 +8,7 @@
 BEGIN { require "t/utils.pl" }
 our (@available_drivers);
 
-use constant TESTS_PER_DRIVER => 70;
+use constant TESTS_PER_DRIVER => 71;
 
 my $total = scalar(@available_drivers) * TESTS_PER_DRIVER;
 plan tests => $total;
@@ -49,6 +49,13 @@
         my $record2 = TestApp::Address->create( _handle => $handle, name => 'Enoch', phone => '123 456 7890');
         isa_ok($record2, 'TestApp::Address');
         ok($record2->id, "Created a record with a class method");
+        is_deeply({ $record2->as_hash }, {
+            id          => $record2->id,
+            employee_id => undef,
+            name        => 'Enoch',
+            address     => '',
+            phone       => '123 456 7890',
+        }, 'as_hash works');
 
         my $clone2 = TestApp::Address->load_by_cols( _handle => $handle, name => 'Enoch');
         isa_ok($clone2, 'TestApp::Address');


More information about the Jifty-commit mailing list