From: woosley Date: Tue, 18 Jan 2011 01:37:27 +0000 (+0800) Subject: update test case for bug fix X-Git-Tag: 0.07~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ec868bffd6e546c06ada4e163bc583518a52488;p=dbsrgits%2FDBIx-Class-DateTime-Epoch.git update test case for bug fix --- diff --git a/t/02-schema.t b/t/02-schema.t index 66f3664..14db53f 100644 --- a/t/02-schema.t +++ b/t/02-schema.t @@ -3,7 +3,7 @@ use warnings; use lib 't/lib'; -use Test::More tests => 15; +use Test::More tests => 16; use DBICx::TestDatabase; use DateTime; @@ -40,6 +40,7 @@ my $rs = $schema->resultset( 'Foo' ); isa_ok( $row->modification_time, 'DateTime' ); like( $row->get_column( 'creation_time' ), qr/^\d+$/, 'TimeStamp as epoch' ); like( $row->get_column( 'modification_time' ), qr/^\d+$/, 'TimeStamp as epoch' ); + like ($row->get_column( 'update_time'), qr/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/, 'TimeStamp still Timestamp'); my $mtime = $row->modification_time; sleep( 1 ); diff --git a/t/lib/MySchema/Foo.pm b/t/lib/MySchema/Foo.pm index ca4f5ba..e98fcc5 100644 --- a/t/lib/MySchema/Foo.pm +++ b/t/lib/MySchema/Foo.pm @@ -38,7 +38,14 @@ __PACKAGE__->add_columns( inflate_datetime => 1, set_on_create => 1, set_on_update => 1, - } + }, + update_time => { + data_type => 'datetime', + set_on_create => 1, + set_on_update => 1, + is_nullable => 1, + }, + ); __PACKAGE__->set_primary_key( 'id' );