From: Rafael Kitover Date: Sun, 5 Dec 2010 14:07:23 +0000 (-0500) Subject: minor changes X-Git-Tag: 0.07003~29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a8fd9497918b9655f0824a520ab4155bbf51a5c;p=dbsrgits%2FDBIx-Class-Schema-Loader.git minor changes --- diff --git a/TODO b/TODO index 53f15ab..c9fcc1e 100644 --- a/TODO +++ b/TODO @@ -41,6 +41,7 @@ catalyst helper, etc. - add result_roles and schema_roles for use with use_moose=1 - generate Schema/ResultBase.pm and Schema/ResultSetBase.pm + - remove additional warnings skip in t/22dump.t for ActivePerl on Win32 - Relationships - Re-scan relations/tables after initial relation setup to find diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index e7da667..0b47def 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -396,7 +396,7 @@ files before creating the new ones from scratch when dumping a schema to disk. The default behavior is instead to only replace the top portion of the file, up to and including the final stanza which contains -C<# DO NOT MODIFY THIS OR ANYTHING ABOVE!> +C<# DO NOT MODIFY THE FIRST PART OF THIS FILE> leaving any customizations you placed after that as they were. When C is not set, if the output file already exists, diff --git a/t/23dumpmore.t b/t/23dumpmore.t index 35750a3..5c3c495 100644 --- a/t/23dumpmore.t +++ b/t/23dumpmore.t @@ -50,10 +50,10 @@ $t->cleanup; close $config_file; $t->dump_test( - classname => 'DBICTest::Schema::_skip_load_external', + classname => 'DBICTest::Schema::_config_file', options => { config_file => "$config_file" }, warnings => [ - qr/Dumping manual schema for DBICTest::Schema::_skip_load_external to directory /, + qr/Dumping manual schema for DBICTest::Schema::_config_file to directory /, qr/Schema dump completed/, ], neg_regexes => { @@ -66,7 +66,7 @@ $t->cleanup; # proper exception $t->dump_test( - classname => 'DBICTest::Schema::_skip_load_external', + classname => 'DBICTest::Schema::_clashing_monikers', test_db_class => 'make_dbictest_db_clashing_monikers', error => qr/tables 'bar', 'bars' reduced to the same source moniker 'Bar'/, ); diff --git a/t/26dump_use_moose.t b/t/26dump_use_moose.t index a794182..9740285 100644 --- a/t/26dump_use_moose.t +++ b/t/26dump_use_moose.t @@ -92,6 +92,7 @@ $t->dump_test( Foo => [ qr/\nuse Moose;\nuse MooseX::NonMoose;\nuse namespace::autoclean;\nextends 'My::ResultBaseClass';\n\n/, qr/\n__PACKAGE__->meta->make_immutable;\n1;(?!\n1;\n)\n.*/, + qr/# XXX This is my custom content XXX/, ], Bar => [ qr/\nuse Moose;\nuse MooseX::NonMoose;\nuse namespace::autoclean;\nextends 'My::ResultBaseClass';\n\n/, @@ -102,7 +103,7 @@ $t->dump_test( $t->cleanup; -# check with a fresh non-moose schema that Moose custom content added to unapgraded schema, and make sure it is not repeated +# check with a fresh non-moose schema that Moose custom content added to a use_moose=0 schema is not repeated $t->dump_test( classname => 'DBICTest::DumpMore::1', options => { @@ -129,7 +130,7 @@ $t->dump_test( # add Moose custom content then check it is not repeated # after that regen again *without* the use_moose flag, make # sure moose isn't stripped away -$t->append_to_class('DBICTest::DumpMore::1::Foo', qq{__PACKAGE__->meta->make_immutable;\n1;\n}); +$t->append_to_class('DBICTest::DumpMore::1::Foo', qq{use Moose;\n__PACKAGE__->meta->make_immutable;\n1;\n}); for my $supply_use_moose (1, 0) { $t->dump_test( @@ -159,6 +160,7 @@ for my $supply_use_moose (1, 0) { }, neg_regexes => { Foo => [ +# qr/\nuse Moose;\n.*\nuse Moose;/s, # TODO qr/\n__PACKAGE__->meta->make_immutable;\n.*\n__PACKAGE__->meta->make_immutable;/s, ], },