X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi-t%2F01-columns.t;h=3380f5202509957f35a7ec8141582a6e2e2ad92f;hb=126042ee4b9394c4eecc6ece49469da6fce23ba3;hp=0841e1e4db681783efe4377ea77b92a81e7552ce;hpb=b6e40530b8ef2ef333b7466a6cd131c460872d03;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi-t/01-columns.t b/t/cdbi-t/01-columns.t index 0841e1e..3380f52 100644 --- a/t/cdbi-t/01-columns.t +++ b/t/cdbi-t/01-columns.t @@ -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;