use namespace::clean;
$| = 1;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
-}
+use lib 't/cdbi/testlib';
+use Film;
ok(Film->can('db_Main'), 'set_db()');
is(Film->__driver, "SQLite", "Driver set correctly");
# Test lazy loading
#----------------------------------------------------------------------
-INIT {
- use lib 't/cdbi/testlib';
- use Lazy;
-}
+use lib 't/cdbi/testlib';
+use Lazy;
is_deeply [ Lazy->columns('Primary') ], [qw/this/], "Pri";
is_deeply [ sort Lazy->columns('Essential') ], [qw/opop this/], "Essential";
@YA::Film::ISA = 'Film';
-#local $SIG{__WARN__} = sub { };
-
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
- use Director;
-}
+use lib 't/cdbi/testlib';
+use Film;
+use Director;
Film->create_test_film;
ok(my $btaste = Film->retrieve('Bad Taste'), "We have Bad Taste");
use warnings;
use Test::More;
+use lib 't/cdbi/testlib';
INIT {
- #local $SIG{__WARN__} =
- #sub { like $_[0], qr/clashes with built-in method/, $_[0] };
- use lib 't/cdbi/testlib';
- require Film;
- require Actor;
- require Director;
+ require Film;
+ require Actor;
+ require Director;
- Actor->has_a(film => 'Film');
- Film->has_a(director => 'Director');
+ Actor->has_a(film => 'Film');
+ Film->has_a(director => 'Director');
- sub Class::DBI::sheep { ok 0; }
+ sub Class::DBI::sheep { ok 0; }
}
# Install the deprecation warning intercept here for the rest of the 08 dev cycle
use Test::More;
use Data::Dumper;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
- use Director;
-}
+use lib 't/cdbi/testlib';
+use Film;
+use Director;
{ # Cascade on delete
Director->has_many(nasties => 'Film');
use strict;
use warnings;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
-}
-
+use lib 't/cdbi/testlib';
+use Film;
Film->create({ Title => $_, Rating => "PG" }) for ("Superman", "Super Fuzz");
Film->create({ Title => "Batman", Rating => "PG13" });
use warnings;
use Test::More;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
-}
+use lib 't/cdbi/testlib';
+use Film;
{
Film->insert({
use warnings;
use Test::More;
-INIT {
- use lib 't/cdbi/testlib';
-}
+use lib 't/cdbi/testlib';
{
package # hide from PAUSE
use warnings;
use Test::More;
-INIT {
- use lib 't/cdbi/testlib';
- require Film;
-}
+use lib 't/cdbi/testlib';
+INIT { require Film }
sub Film::get_test {
my $self = shift;
$| = 1;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
-}
+use lib 't/cdbi/testlib';
+use Film;
plan skip_all => "Object cache is turned off"
if Film->isa("DBIx::Class::CDBICompat::NoObjectIndex");
use warnings;
use Test::More;
-INIT {
- use lib 't/cdbi/testlib';
- use Film;
-}
+use lib 't/cdbi/testlib';
+use Film;
for my $title ("Bad Taste", "Braindead", "Forgotten Silver") {
Film->insert({ Title => $title, Director => 'Peter Jackson' });