add firebird warning for unquoted_ddl option
Rafael Kitover [Tue, 30 Mar 2010 23:32:07 +0000 (19:32 -0400)]
lib/DBIx/Class/Schema/Loader/DBI/InterBase.pm
t/18firebird_common.t

index f200ef3..bcd9ad2 100644 (file)
@@ -58,6 +58,16 @@ sub _setup {
 
     $self->schema->storage->sql_maker->name_sep('.');
 
+    if (not defined $self->unquoted_ddl) {
+        warn <<'EOF';
+
+WARNING: Assuming mixed-case Firebird DDL, see the unquoted_ddl option in
+perldoc DBIx::Class::Schema::Loader::DBI::InterBase
+for more information.
+
+EOF
+    }
+
     if (not $self->unquoted_ddl) {
         $self->schema->storage->sql_maker->quote_char('"');
     }
index 295bec3..9d71c1c 100644 (file)
@@ -55,7 +55,7 @@ my $tester = dbixcsl_common_tests->new(
         } : ()),
     ],
     extra => {
-        count  => 6,
+        count  => 7,
         run    => sub {
             $schema = shift;
 
@@ -87,8 +87,16 @@ q{
 
             my $guard = Scope::Guard->new(\&cleanup_extra);
 
-            $schema->_loader->{unquoted_ddl} = 0;
-            $schema->_loader->_setup;
+            delete $schema->_loader->{unquoted_ddl};
+
+            my $warning;
+            {
+                local $SIG{__WARN__} = sub { $warning = shift };
+                $schema->_loader->_setup;
+            }
+            like $warning, qr/unquoted_ddl option/,
+                'warning mentions unquoted_ddl option';
+
             {
                 local $SIG{__WARN__} = sub {};
                 $schema->rescan;