Changed deflate test to work with a real object
[dbsrgits/DBIx-Class.git] / t / 08inflate.t
CommitLineData
51516b1c 1use Test::More;
cabca325 2use DateTime;
51516b1c 3
4plan tests => 4;
5
6use lib qw(t/lib);
7
8use_ok('DBICTest');
9
10# inflation test
11my $cd = DBICTest::CD->retrieve(3);
12is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
13
14is( $cd->year->month, 1, 'inflated month ok' );
15
16# deflate test
cabca325 17my $now = DateTime->now;
18$cd->year( $now );
51516b1c 19$cd->update;
20
cabca325 21($cd) = DBICTest::CD->search( year => $now->year );
22is( $cd->year, $now->year, 'deflate ok' );