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