X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20invocations.t;h=059eda1bb625fbc5eba67ad6abca4096fb6dcf7d;hb=eb40e254f05cde1286ef0f38e153c666dc3586f1;hp=170dd77c1f47b923f9ddeae78a168b74cf74df3d;hpb=0c344f4e2db55db5fcd28b474a6f0370cf74c098;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/20invocations.t b/t/20invocations.t index 170dd77..059eda1 100644 --- a/t/20invocations.t +++ b/t/20invocations.t @@ -32,6 +32,7 @@ my @invocations = ( package DBICTest::Schema::_hardcode; use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->naming('current'); + __PACKAGE__->use_namespaces(0); __PACKAGE__->connection($make_dbictest_db::dsn); __PACKAGE__; }, @@ -40,13 +41,18 @@ my @invocations = ( use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->loader_options(); __PACKAGE__->naming('current'); + __PACKAGE__->use_namespaces(0); __PACKAGE__->connect($make_dbictest_db::dsn); }, 'make_schema_at' => sub { use DBIx::Class::Schema::Loader qw/ make_schema_at /; make_schema_at( 'DBICTest::Schema::_make_schema_at', - { really_erase_my_files => 1, naming => 'current' }, + { + really_erase_my_files => 1, + naming => 'current', + use_namespaces => 0 + }, [ $make_dbictest_db::dsn ], ); DBICTest::Schema::_make_schema_at->clone; @@ -55,6 +61,7 @@ my @invocations = ( package DBICTest::Schema::_embedded_options; use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->naming('current'); + __PACKAGE__->use_namespaces(0); __PACKAGE__->connect( $make_dbictest_db::dsn, { loader_options => { really_erase_my_files => 1 } } @@ -64,6 +71,7 @@ my @invocations = ( package DBICTest::Schema::_embedded_options_in_attrs; use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->naming('current'); + __PACKAGE__->use_namespaces(0); __PACKAGE__->connect( $make_dbictest_db::dsn, undef, @@ -80,7 +88,8 @@ my @invocations = ( $make_dbictest_db::dsn, { loader_options => { really_erase_my_files => 1, - naming => 'current' + naming => 'current', + use_namespaces => 0, } }, ], ); @@ -91,7 +100,8 @@ my @invocations = ( use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->loader_options( really_erase_my_files => 1, - naming => 'current' + naming => 'current', + use_namespaces => 0, ); __PACKAGE__->connect( $make_dbictest_db::dsn, @@ -102,27 +112,40 @@ my @invocations = ( use DBIx::Class::Schema::Loader; DBIx::Class::Schema::Loader::make_schema_at( 'DBICTest::Schema::_make_schema_at_explicit', - { really_erase_my_files => 1, naming => 'current' }, + { + really_erase_my_files => 1, + naming => 'current', + use_namespaces => 0, + }, [ $make_dbictest_db::dsn ], ); DBICTest::Schema::_make_schema_at_explicit->clone; }, 'no_skip_load_external' => sub { - # By default we should pull in t/lib/DBICTest/Schema/13/Foo.pm $skip_me since t/lib is in @INC + # By default we should pull in t/lib/DBICTest/Schema/_no_skip_load_external/Foo.pm $skip_me since t/lib is in @INC use DBIx::Class::Schema::Loader; DBIx::Class::Schema::Loader::make_schema_at( 'DBICTest::Schema::_no_skip_load_external', - { really_erase_my_files => 1, naming => 'current' }, + { + really_erase_my_files => 1, + naming => 'current', + use_namespaces => 0, + }, [ $make_dbictest_db::dsn ], ); DBICTest::Schema::_no_skip_load_external->clone; }, 'skip_load_external' => sub { - # When we explicitly skip_load_external t/lib/DBICTest/Schema/14/Foo.pm should be ignored + # When we explicitly skip_load_external t/lib/DBICTest/Schema/_skip_load_external/Foo.pm should be ignored use DBIx::Class::Schema::Loader; DBIx::Class::Schema::Loader::make_schema_at( 'DBICTest::Schema::_skip_load_external', - { really_erase_my_files => 1, naming => 'current', skip_load_external => 1 }, + { + really_erase_my_files => 1, + naming => 'current', + use_namespaces => 0, + skip_load_external => 1, + }, [ $make_dbictest_db::dsn ], ); DBICTest::Schema::_skip_load_external->clone; @@ -132,6 +155,7 @@ my @invocations = ( package DBICTest::Schema::_use_moose; use base qw/ DBIx::Class::Schema::Loader /; __PACKAGE__->naming('current'); + __PACKAGE__->use_namespaces(0); __PACKAGE__->connect( $make_dbictest_db::dsn, { loader_options => { use_moose => 1 } } @@ -150,7 +174,7 @@ while(@invocations) { my $schema = do { local $SIG{__WARN__} = sub { - warn $_[0] unless $_[0] =~ /really_erase_my_files/ + warn $_[0] unless $_[0] =~ /Deleting existing file .+ due to 'really_erase_my_files' setting/ }; $cref->(); };