use inc::Module::Install;
if ($Module::Install::AUTHOR) {
- system('pod2text lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm > README');
- system('pod2html lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm > README.html');
+ system(
+ 'pod2text lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm > README'
+ );
+ system(
+ 'pod2html lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm > README.html'
+ );
}
name 'DBIx-Class-ResultSource-MultipleTableInheritance';
all_from 'lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm';
+configure_requires 'DBIx::Class' => '0.08124';
+require DBIx::Class::Optional::Dependencies;
+
+my $deploy_deps = DBIx::Class::Optional::Dependencies->req_list_for('deploy');
+
+for ( keys %$deploy_deps ) {
+ requires $_ => $deploy_deps->{$_};
+}
+
requires 'Carp::Clan';
requires 'DBIx::Class';
requires 'Method::Signatures::Simple';
--- /dev/null
+use strict;
+use warnings;
+use lib 't/lib';
+use Test::More qw(no_plan);
+
+BEGIN { use_ok $_ for qw/MTITest NoSequence Cafe/; }
$ENV{DBIC_TRACE} = 0;
}
+my ( $dsn, $user, $pass )
+ = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
+
+plan skip_all => <<'EOM' unless $dsn && $user;
+Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
+( NOTE: This test drops and creates some tables.')
+EOM
+
dies_ok { MTITest->source('Foo')->view_definition }
"Can't generate view def without connected schema";
-my $schema = MTITest->connect( 'dbi:Pg:dbname=test', 'postgres', '' );
+my $schema = MTITest->connect( $dsn, $user, $pass );
my $dir = "t/sql"; # tempdir(CLEANUP => 0);
-#$schema->storage->dbh->{Warn} = 0;
-$schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir );
-$schema->deploy( { add_drop_table => 1, add_drop_view => 1} );
+$schema->storage->dbh->{Warn} = 0;
+lives_ok { $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir ) }
+"It's OK to create_ddl_dir";
+lives_ok {
+ $schema->deploy(
+ { add_drop_table => 1, add_drop_view => 1, } );
+}
+"It's also OK to deploy the schema";
use_ok 'Cafe';
$ENV{DBIC_TRACE} = 0;
}
-
-my $schema = Cafe->connect( 'dbi:Pg:dbname=test', 'postgres', '' );
+my ( $dsn, $user, $pass )
+ = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
+plan skip_all => <<'EOM' unless $dsn && $user;
+Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
+( NOTE: This test drops and creates some tables.')
+EOM
+
+my $schema = Cafe->connect( $dsn, $user, $pass );
$schema->storage->dbh->{Warn} = 0;
$schema->storage->ensure_connected;
$schema->storage->_use_insert_returning(0);
}
"I can do it for the other view, too";
-
$ENV{DBIC_TRACE} = 0;
}
-my $schema = NoSequence->connect( 'dbi:Pg:dbname=test', 'postgres', '' );
+my ( $dsn, $user, $pass )
+ = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
+
+plan skip_all => <<'EOM' unless $dsn && $user;
+Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
+( NOTE: This test drops and creates some tables.')
+EOM
+
+my $schema = NoSequence->connect( $dsn, $user, $pass );
$schema->storage->dbh->{Warn} = 0;
$schema->storage->ensure_connected;
$schema->storage->_use_insert_returning(0);
}
"I can do it for the other view, too";
-