Emulate that Class::DBI inflates immediately
[dbsrgits/DBIx-Class.git] / t / cdbi-t / columns_as_hashes.t
index 70f887e..24dbc2a 100644 (file)
@@ -87,4 +87,19 @@ warning_is {
     ok !eval { $actor->film };
     is $actor->{film}->id, $waves->id,
        'hash access still works despite lack of accessor';
+}
+
+
+# Emulate that Class::DBI inflates immediately
+{
+    require_ok 'MyFoo';
+    
+    my $foo = MyFoo->insert({
+        name    => 'Whatever',
+        tdate   => '1949-02-01',
+    });
+    isa_ok $foo, 'MyFoo';
+    
+    isa_ok $foo->{tdate}, 'Date::Simple';
+    is $foo->{tdate}->year, 1949;
 }
\ No newline at end of file