Finally implement compound OptDep group augmentation
[dbsrgits/DBIx-Class.git] / t / cdbi / 70_implicit_inflate.t
CommitLineData
2baba3d9 1use DBIx::Class::Optional::Dependencies -skip_all_without => qw( rdbms_sqlite icdt );
cb551b07 2
2040ad73 3use strict;
4use warnings;
5
6# Class::DBI in its infinate wisdom allows implicit inflation
7# and deflation of foriegn clas looups in has_a relationships.
8# for inflate it would call ->new on the foreign_class and for
9# deflate it would "" the column value and allow for overloading
10# of the "" operator.
11
12use Test::More;
2040ad73 13
14use lib 't/cdbi/testlib';
15use ImplicitInflate;
16
17ok(ImplicitInflate->can('db_Main'), 'set_db()');
18is(ImplicitInflate->__driver, "SQLite", 'Driver set correctly');
19
20my $now = DateTime->now;
21
22ImplicitInflate->create({
23 update_datetime => $now,
24 text => "Test Data",
25});
26
27my $implicit_inflate = ImplicitInflate->retrieve(text => 'Test Data');
28
29ok($implicit_inflate->update_datetime->isa('DateTime'), 'Date column inflated correctly');
30is($implicit_inflate->update_datetime => $now, 'Date has correct year');
31
32done_testing;