X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2Fcolumns_as_hashes.t;h=fcb6b17321a2334deecf09ed2ed8cb148c961ce6;hb=4b8da207a3460216711d73987feaa13f7107ecc3;hp=6a9b1bca676dd880fafea5c153658a1cb0bf29d4;hpb=89bddb490d9a159ebf4e08ec99e5651d76ec5ad4;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index 6a9b1bc..fcb6b17 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -2,11 +2,6 @@ use strict; use Test::More; use Test::Warn; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - plan skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@" if $@; -} - use lib 't/cdbi/testlib'; use Film; @@ -52,15 +47,15 @@ warning_is { } '', 'DBIC_CDBICOMPAT_HASH_WARN controls warnings'; -{ +{ $waves->rating("R"); $waves->update; - + no warnings 'redefine'; local *Film::rating = sub { return "wibble"; }; - + is $waves->{rating}, "R"; } @@ -73,7 +68,7 @@ warning_is { return "movie" if lc $col eq "film"; return $col; }; - + require Actor; Actor->has_a( film => "Film" ); @@ -81,7 +76,7 @@ warning_is { name => 'Emily Watson', film => $waves, }); - + ok !eval { $actor->film }; is $actor->{film}->id, $waves->id, 'hash access still works despite lack of accessor'; @@ -90,14 +85,17 @@ warning_is { # Emulate that Class::DBI inflates immediately SKIP: { - skip "Need MySQL to run this test", 3 unless eval { require MyFoo }; - + unless (eval { require MyFoo }) { + my ($err) = $@ =~ /([^\n]+)/; + skip $err, 3 + } + my $foo = MyFoo->insert({ name => 'Whatever', tdate => '1949-02-01', }); isa_ok $foo, 'MyFoo'; - + isa_ok $foo->{tdate}, 'Date::Simple'; is $foo->{tdate}->year, 1949; }