X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2Fcolumns_as_hashes.t;h=f10f522c4ccff6f7e28492b9a5808d2eb2648a46;hb=4a233f3019d2baa4bf2abee0c873c74d5cdf3a11;hp=06fc149e30db8bf63cefa8038e63b439e4441d01;hpb=49b3a2641b8687764378abc01554bb8804a4bc26;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index 06fc149..f10f522 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -1,12 +1,8 @@ use strict; +use warnings; 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 +48,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 +69,7 @@ warning_is { return "movie" if lc $col eq "film"; return $col; }; - + require Actor; Actor->has_a( film => "Film" ); @@ -81,7 +77,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'; @@ -100,7 +96,7 @@ SKIP: { tdate => '1949-02-01', }); isa_ok $foo, 'MyFoo'; - + isa_ok $foo->{tdate}, 'Date::Simple'; is $foo->{tdate}->year, 1949; }