'MooseX::Types' => '0.21',
};
+my $admin_basic = {
+ %$moose_basic,
+ 'MooseX::Types::Path::Class' => '0.05',
+ 'MooseX::Types::JSON' => '0.02',
+ 'namespace::autoclean' => '0.09',
+ 'parent' => '0.223',
+};
+
my $reqs = {
dist => {
#'Module::Install::Pod::Inherit' => '0.01',
admin => {
req => {
+ %$admin_basic,
+ },
+ pod => {
+ title => 'DBIx::Class::Admin',
+ desc => 'Modules required for the DBIx::Class administrative library',
+ },
+ },
+
+ dbicadmin => {
+ req => {
%$moose_basic,
- 'MooseX::Types::Path::Class'=> '0.05',
- 'MooseX::Types::JSON' => '0.02',
- 'namespace::autoclean' => '0.09',
- 'parent' => '0.223',
+ %$admin_basic,
'Getopt::Long::Descriptive' => '0.081',
'JSON::Any' => '1.22',
'Text::CSV' => '1.16',
use Test::More;
-
BEGIN {
- eval "use DBIx::Class::Admin";
- plan skip_all => "Deps not installed: $@" if $@;
+ require DBIx::Class;
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('admin');
}
use_ok 'DBIx::Class::Admin';
use Test::Exception;
use Test::Warn;
-
BEGIN {
- eval "use DBIx::Class::Admin";
- plan skip_all => "Deps not installed: $@" if $@;
-}
+ require DBIx::Class;
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('admin');
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('deploy')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('deploy');
+}
use lib qw(t/lib);
use DBICTest;
#);
clean_dir($sql_dir);
-require DBICVersionOrig;
+require DBICVersion_v1;
my $admin = DBIx::Class::Admin->new(
schema_class => 'DBICVersion::Schema',
is($schema->get_db_version, $DBICVersion::Schema::VERSION, 'Schema deployed and versions match');
-require DBICVersionNew;
+require DBICVersion_v2;
$admin = DBIx::Class::Admin->new(
schema_class => 'DBICVersion::Schema',
);
lives_ok { $admin->create($schema->storage->sqlt_type(), {}, "1.0" ); } 'Can create diff for ' . $schema->storage->sqlt_type;
-# sleep required for upgrade table to hold a distinct time of upgrade value
-# otherwise the returned of get_db_version can be undeterministic
-sleep 1;
{
local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DB version .+? is lower than the schema version/ };
lives_ok {$admin->upgrade();} 'upgrade the schema';
lives_ok { $admin->install(); } 'install schema version 3.0';
is($admin->schema->get_db_version, "3.0", 'db thinks its version 3.0');
dies_ok { $admin->install("4.0"); } 'cannot install to allready existing version';
-sleep 1;
+
$admin->force(1);
warnings_exist ( sub {
lives_ok { $admin->install("4.0") } 'can force install to allready existing version'
use Test::Deep;
BEGIN {
- eval "use DBIx::Class::Admin";
- plan skip_all => "Deps not installed: $@" if $@;
+ require DBIx::Class;
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('admin');
}
use lib 't/lib';
BEGIN {
- eval "require DBIx::Class::Admin";
- plan skip_all => "Deps not installed: $@" if $@;
-
- eval "require Getopt::Long::Descriptive";
- plan skip_all => 'Install Getopt::Long::Descriptive to run this test' if ($@);
-
- eval 'require JSON::Any';
- plan skip_all => 'Install JSON::Any to run this test' if ($@);
-
- eval 'require Text::CSV_XS';
- if ($@) {
- eval 'require Text::CSV_PP';
- plan skip_all => 'Install Text::CSV_XS or Text::CSV_PP to run this test' if ($@);
- }
+ require DBIx::Class;
+ plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('dbicadmin')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('dbicadmin');
}
+
my @json_backends = qw/XS JSON DWIW/;
my $tests_per_run = 5;
}
sub test_dbicadmin {
-# $ENV{PERL5LIB} = join ':', @INC;
-
my $schema = DBICTest->init_schema( sqlite_use_file => 1 ); # reinit a fresh db for every run
my $employees = $schema->resultset('Employee');