[Bast-commits] r3606 - trunk/DBIx-Class/t
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Fri Jul 27 01:20:54 GMT 2007
Author: matthewt
Date: 2007-07-27 01:20:54 +0100 (Fri, 27 Jul 2007)
New Revision: 3606
Added:
trunk/DBIx-Class/t/36datetime.t
Log:
missed adding the test
Added: trunk/DBIx-Class/t/36datetime.t
===================================================================
--- trunk/DBIx-Class/t/36datetime.t (rev 0)
+++ trunk/DBIx-Class/t/36datetime.t 2007-07-27 00:20:54 UTC (rev 3606)
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+
+eval { require DateTime::Format::MySQL };
+
+plan $@ ? ( skip_all => 'Requires DateTime::Format::MySQL' )
+ : ( tests => 3 );
+
+my $schema = DBICTest->init_schema(
+ no_deploy => 1, # Deploying would cause an early rebless
+);
+
+is(
+ ref $schema->storage, 'DBIx::Class::Storage::DBI',
+ 'Starting with generic storage'
+);
+
+# Calling date_time_parser should cause the storage to be reblessed,
+# so that we can pick up datetime_parser_type from subclasses
+
+my $parser = $schema->storage->datetime_parser();
+
+# We're currently expecting a MySQL parser. May change in future.
+is($parser, 'DateTime::Format::MySQL', 'Got expected datetime_parser');
+
+isa_ok($schema->storage, 'DBIx::Class::Storage::DBI::SQLite', 'storage');
+
More information about the Bast-commits
mailing list