Made source_name read-only on source instances, r/w on classes
[dbsrgits/DBIx-Class.git] / t / 68inflate.t
index b730253..6cbc96d 100644 (file)
@@ -7,12 +7,18 @@ use DBICTest;
 
 my $schema = DBICTest->init_schema();
 
+DBICTest::Schema::CD->add_column('year2');
+$DB::single = 1;
 eval { require DateTime };
 plan skip_all => "Need DateTime for inflation tests" if $@;
 
-plan tests => 3;
+plan tests => 4;
 
-DBICTest::Schema::CD->inflate_column( 'year',
+$DB::single = 1;
+
+$schema->class('CD')
+#DBICTest::Schema::CD
+->inflate_column( 'year',
     { inflate => sub { DateTime->new( year => shift ) },
       deflate => sub { shift->year } }
 );
@@ -23,6 +29,8 @@ my $cd = $schema->resultset("CD")->find(3);
 
 is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
 
+is( $cd->year->year, 1997, 'inflated year ok' );
+
 is( $cd->year->month, 1, 'inflated month ok' );
 
 # deflate test