[Bast-commits] r3174 - in branches/DBIx-Class-Schema-Loader/current: . lib/DBIx/Class/Schema/Loader t

blblack at dev.catalyst.perl.org blblack at dev.catalyst.perl.org
Tue Apr 3 02:12:25 GMT 2007


Author: blblack
Date: 2007-04-03 02:12:24 +0100 (Tue, 03 Apr 2007)
New Revision: 3174

Added:
   branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t
Modified:
   branches/DBIx-Class-Schema-Loader/current/
   branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
   branches/DBIx-Class-Schema-Loader/current/t/
   branches/DBIx-Class-Schema-Loader/current/t/20invocations.t
   branches/DBIx-Class-Schema-Loader/current/t/21misc_fatal.t
   branches/DBIx-Class-Schema-Loader/current/t/22dump.t
Log:
some little cleanups, svn meta stuff, and the beginnings a new test file for the new dump code


Property changes on: branches/DBIx-Class-Schema-Loader/current
___________________________________________________________________
Name: svn:ignore
   + Build
_build
*.bak
blib
README
MANIFEST
META.yml
*gz


Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm	2007-04-02 22:19:05 UTC (rev 3173)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/Base.pm	2007-04-03 01:12:24 UTC (rev 3174)
@@ -568,7 +568,7 @@
     $self->_use   ($table_class, @{$self->additional_classes});
     $self->_inject($table_class, @{$self->additional_base_classes});
 
-    $self->_dbic_stmt($table_class, 'load_components', @{$self->components}, qw/PK::Auto Core/);
+    $self->_dbic_stmt($table_class, 'load_components', @{$self->components}, 'Core');
 
     $self->_dbic_stmt($table_class, 'load_resultset_components', @{$self->resultset_components})
         if @{$self->resultset_components};


Property changes on: branches/DBIx-Class-Schema-Loader/current/t
___________________________________________________________________
Name: svn:ignore
   + _dump


Modified: branches/DBIx-Class-Schema-Loader/current/t/20invocations.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/20invocations.t	2007-04-02 22:19:05 UTC (rev 3173)
+++ branches/DBIx-Class-Schema-Loader/current/t/20invocations.t	2007-04-03 01:12:24 UTC (rev 3174)
@@ -37,7 +37,7 @@
         use DBIx::Class::Schema::Loader qw/ make_schema_at /;
         make_schema_at(
             'DBICTest::Schema::7',
-            { relationships => 1 },
+            { dump_overwrite => 1 },
             [ $make_dbictest_db::dsn ],
         );
         DBICTest::Schema::7->clone;
@@ -47,7 +47,7 @@
         use base qw/ DBIx::Class::Schema::Loader /;
         __PACKAGE__->connect(
             $make_dbictest_db::dsn,
-            { loader_options => { relationships => 1 } }
+            { loader_options => { dump_overwrite => 1 } }
         );
     },
     'embedded_options_in_attrs' => sub {
@@ -57,7 +57,7 @@
             $make_dbictest_db::dsn,
             undef,
             undef,
-            { AutoCommit => 1, loader_options => { relationships => 1 } }
+            { AutoCommit => 1, loader_options => { dump_overwrite => 1 } }
         );
     },
     'embedded_options_make_schema_at' => sub {
@@ -67,7 +67,7 @@
             { },
             [
                 $make_dbictest_db::dsn,
-                { loader_options => { relationships => 1 } },
+                { loader_options => { dump_overwrite => 1 } },
             ],
         );
         "DBICTest::Schema::10";
@@ -75,7 +75,7 @@
     'almost_embedded' => sub {
         package DBICTest::Schema::11;
         use base qw/ DBIx::Class::Schema::Loader /;
-        __PACKAGE__->loader_options( relationships => 1 );
+        __PACKAGE__->loader_options( dump_overwrite => 1 );
         __PACKAGE__->connect(
             $make_dbictest_db::dsn,
             undef, undef, { AutoCommit => 1 }
@@ -85,7 +85,7 @@
         use DBIx::Class::Schema::Loader;
         DBIx::Class::Schema::Loader::make_schema_at(
             'DBICTest::Schema::12',
-            { relationships => 1 },
+            { dump_overwrite => 1 },
             [ $make_dbictest_db::dsn ],
         );
         DBICTest::Schema::12->clone;

Modified: branches/DBIx-Class-Schema-Loader/current/t/21misc_fatal.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/21misc_fatal.t	2007-04-02 22:19:05 UTC (rev 3173)
+++ branches/DBIx-Class-Schema-Loader/current/t/21misc_fatal.t	2007-04-03 01:12:24 UTC (rev 3174)
@@ -12,7 +12,7 @@
 
     package DBICTest::Schema;
     use base qw/ DBIx::Class::Schema::Loader /;
-    __PACKAGE__->loader_options( relationships => 1 );
+    __PACKAGE__->loader_options( dump_overwrite => 1 );
     __PACKAGE__->storage_type( '::xyzzy' );
 }
 

Modified: branches/DBIx-Class-Schema-Loader/current/t/22dump.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/22dump.t	2007-04-02 22:19:05 UTC (rev 3173)
+++ branches/DBIx-Class-Schema-Loader/current/t/22dump.t	2007-04-03 01:12:24 UTC (rev 3174)
@@ -10,7 +10,6 @@
     package DBICTest::Schema::1;
     use base qw/ DBIx::Class::Schema::Loader /;
     __PACKAGE__->loader_options(
-        relationships => 1,
         dump_directory => $dump_path,
     );
 }
@@ -19,7 +18,6 @@
     package DBICTest::Schema::2;
     use base qw/ DBIx::Class::Schema::Loader /;
     __PACKAGE__->loader_options(
-        relationships => 1,
         dump_directory => $dump_path,
         dump_overwrite => 1,
     );

Added: branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t	                        (rev 0)
+++ branches/DBIx-Class-Schema-Loader/current/t/23dumpmore.t	2007-04-03 01:12:24 UTC (rev 3174)
@@ -0,0 +1,48 @@
+use strict;
+use Test::More;
+use lib qw(t/lib);
+use File::Path;
+use make_dbictest_db;
+require DBIx::Class::Schema::Loader;
+
+plan tests => 5;
+
+plan skip_all => "ActiveState perl produces additional warnings"
+    if ($^O eq 'MSWin32');
+
+my $dump_path = './t/_dump';
+
+sub do_dump_test {
+    my ($schema_class, $opts) = @_;
+
+    rmtree($dump_path, 1, 1);
+
+    no strict 'refs';
+    @{$schema_class . '::ISA'} = ('DBIx::Class::Schema::Loader');
+    $schema_class->loader_options(dump_directory => $dump_path, %$opts);
+
+    my @warn_output;
+    eval {
+        local $SIG{__WARN__} = sub { push(@warn_output, @_) };
+        $schema_class->connect($make_dbictest_db::dsn);
+    };
+    my $err = $@;
+    $schema_class->storage->disconnect if !$err && $schema_class->storage;
+    undef *{$schema_class};
+    return ($err, \@warn_output);
+}
+
+
+{
+    my ($err, $warn) = do_dump_test('DBICTest::Schema::1', { });
+    ok(!$err);
+    is(@$warn, 2);
+    like($warn->[0], qr/Dumping manual schema for DBICTest::Schema::1 to directory /);
+    like($warn->[1], qr/Schema dump completed/);
+}
+
+ok(1);
+
+# XXX obviously this test file needs to be fleshed out more :)
+
+# END { rmtree($dump_path, 1, 1); }




More information about the Bast-commits mailing list