DBIx::Class is now a component loader
[dbsrgits/DBIx-Class.git] / t / cdbi-t / 01-columns.t
index 0841e1e..3380f52 100644 (file)
@@ -8,6 +8,7 @@ use Test::More tests => 25;
 package State;
 
 use base 'DBIx::Class';
+State->load_components(qw/CDBICompat Core/);
 
 State->table('State');
 State->columns(Essential => qw/Abbreviation Name/);
@@ -34,6 +35,7 @@ sub Snowfall { 1 }
 package City;
 
 use base 'DBIx::Class';
+City->load_components(qw/CDBICompat Core/);
 
 City->table('City');
 City->columns(All => qw/Name State Population/);
@@ -43,6 +45,7 @@ City->has_a(State => 'State');
 #-------------------------------------------------------------------------
 package CD;
 use base 'DBIx::Class';
+CD->load_components(qw/CDBICompat Core/);
 
 CD->table('CD');
 CD->columns('All' => qw/artist title length/);
@@ -101,8 +104,12 @@ ok(!State->find_column('HGLAGAGlAG'), '!find_column HGLAGAGlAG');
 }
 
 {
+        package DieTest;
+        @DieTest::ISA = qw(DBIx::Class);
+        DieTest->load_components(qw/Core/);
+        package main;
        local $SIG{__WARN__} = sub { };
-       eval { DBIx::Class->retrieve(1) };
+       eval { DieTest->retrieve(1) };
        like $@, qr/Can't retrieve unless primary columns are defined/, "Need primary key for retrieve";
 }
 
@@ -113,6 +120,7 @@ package State;
 
 package A;
 @A::ISA = qw(DBIx::Class);
+__PACKAGE__->load_components(qw/CDBICompat Core/);
 __PACKAGE__->columns(Primary => 'id');
 
 package A::B;