From: Peter Rabbitson Date: Mon, 6 Sep 2010 11:45:42 +0000 (+0200) Subject: use_moose is an *optional* extra for Schema::Loader, as such blindly X-Git-Tag: 0.07002~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab0262bd69a59ab5811ed9abc679b655ec3cecf8;p=dbsrgits%2FDBIx-Class-Schema-Loader.git use_moose is an *optional* extra for Schema::Loader, as such blindly switching the entire suite to it is a bad idea. A use_moose specific test will be added soon, but the core of S::L needs to test the traditional way. In order to switch the entire test to use_moose set $ENV{SCHEMA_LOADER_TESTS_USE_MOOSE} --- diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index d3086ac..1f439ed 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -182,11 +182,19 @@ sub setup_schema { my $debug = ($self->{verbose} > 1) ? 1 : 0; - my $use_moose = DBIx::Class::Schema::Loader::Optional::Dependencies->req_ok_for('use_moose'); + if ( + $ENV{SCHEMA_LOADER_TESTS_USE_MOOSE} + && + ! DBIx::Class::Schema::Loader::Optional::Dependencies->req_ok_for('use_moose') + ) { + die sprintf ("Missing dependencies for SCHEMA_LOADER_TESTS_USE_MOOSE: %s\n", + DBIx::Class::Schema::Loader::Optional::Dependencies->req_missing_for('use_moose') + ); + } my %loader_opts = ( constraint => - qr/^(?:\S+\.)?(?:(?:$self->{vendor}|extra)_?)?loader_?test[0-9]+(?!.*_)/i, + qr/^(?:\S+\.)?(?:(?:$self->{vendor}|extra)_?)?loader_?test[0-9]+(?!.*_)/i, relationships => 1, additional_classes => 'TestAdditional', additional_base_classes => 'TestAdditionalBase', @@ -202,7 +210,7 @@ sub setup_schema { dump_directory => $DUMP_DIR, datetime_timezone => 'Europe/Berlin', datetime_locale => 'de_DE', - use_moose => $use_moose, + use_moose => $ENV{SCHEMA_LOADER_TESTS_USE_MOOSE}, %{ $self->{loader_options} || {} }, );