From: Peter Rabbitson Date: Wed, 11 Feb 2015 16:31:38 +0000 (+0100) Subject: Revert c8dc7d33 - entirely superseded by 83eef5621 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3225bc713250e9cd32a834aeec120ea996ea8431;p=dbsrgits%2FDBIx-Class.git Revert c8dc7d33 - entirely superseded by 83eef5621 --- diff --git a/Changes b/Changes index b06a571..6015192 100644 --- a/Changes +++ b/Changes @@ -4,9 +4,6 @@ Revision history for DBIx::Class - Silence with_deferred_fk_checks() warning on PostgreSQL 9.4 - Fix updating multiple CLOB/BLOB columns on Oracle - * Misc - - Speed up skipping CDBICompat tests when dependencies are missing - 0.082801 2014-10-05 23:55 (UTC) * Known Issues - Passing large amounts of objects with stringification overload diff --git a/lib/DBIx/Class/CDBICompat.pm b/lib/DBIx/Class/CDBICompat.pm index b87c997..f2bb881 100644 --- a/lib/DBIx/Class/CDBICompat.pm +++ b/lib/DBIx/Class/CDBICompat.pm @@ -4,9 +4,20 @@ use strict; use warnings; use base qw/DBIx::Class::Core DBIx::Class::DB/; -unless (DBIx::Class::Optional::Dependencies->req_ok_for('cdbicompat')) { - __PACKAGE__->throw_exception(Class::Optional::Dependencies->req_missing_for('cdbicompat') . ' are missing and are required for CDBICompat'); +# Modules CDBICompat needs that DBIx::Class does not. +my @Extra_Modules = qw( + Class::Trigger + DBIx::ContextualFetch + Clone +); + +my @didnt_load; +for my $module (@Extra_Modules) { + push @didnt_load, $module unless eval qq{require $module}; } +__PACKAGE__->throw_exception("@{[ join ', ', @didnt_load ]} are missing and are required for CDBICompat") + if @didnt_load; + __PACKAGE__->load_own_components(qw/ Constraints diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 48f8164..7b73889 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -255,34 +255,13 @@ my $reqs = { test_cdbicompat => { req => { + 'Class::DBI::Plugin::DeepAbstractSearch' => '0', %$datetime_basic, 'Time::Piece::MySQL' => '0', 'Date::Simple' => '3.03', }, }, - test_cdbicompat_deepabstractsearch => { - req => { - 'Class::DBI::Plugin::DeepAbstractSearch' => '0', - }, - }, - - cdbicompat => { - req => { - 'Class::Trigger' => '0', - 'DBIx::ContextualFetch' => '0', - 'Clone' => '0', - }, - }, - - cdbicompat => { - req => { - 'Class::Trigger' => '0', - 'DBIx::ContextualFetch' => '0', - 'Clone' => '0', - }, - }, - # this is just for completeness as SQLite # is a core dep of DBIC for testing rdbms_sqlite => { diff --git a/t/cdbi/71_column_object.t b/t/cdbi/71_column_object.t index 045b07a..cc998c3 100644 --- a/t/cdbi/71_column_object.t +++ b/t/cdbi/71_column_object.t @@ -6,11 +6,6 @@ use warnings; use Test::More; -BEGIN { - eval { require Class::DBI::Column } - or plan skip_all => 'Class::DBI::Column required for this test'; -} - use lib 't/cdbi/testlib'; use ColumnObject; diff --git a/t/cdbi/testlib/DBIC/Test/SQLite.pm b/t/cdbi/testlib/DBIC/Test/SQLite.pm index e17c408..905ed88 100644 --- a/t/cdbi/testlib/DBIC/Test/SQLite.pm +++ b/t/cdbi/testlib/DBIC/Test/SQLite.pm @@ -41,16 +41,14 @@ use Test::More; # change too much BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 } -BEGIN { - require DBIx::Class::Optional::Dependencies; - DBIx::Class::Optional::Dependencies->req_ok_for($_) - or plan skip_all => DBIx::Class::Optional::Dependencies->req_missing_for($_) . ' required for this test' - for qw(cdbicompat test_cdbicompat); -} - use lib 't/lib'; use DBICTest; +BEGIN { + eval { require DBIx::Class::CDBICompat } + or plan skip_all => 'Class::DBI required for this test'; +} + use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/CDBICompat Core DB/);