X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F26-mutator.t;h=7042731b3840c961318616029662fbb342c9b278;hb=c0329273268971824784f239f32c7246e68da9c5;hp=5a1cf8f25c94c6db155cb8954a24cf3dc1ccf5b5;hpb=50891152d0b24649bfd67bdba97feec86b11c064;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/cdbi/26-mutator.t b/t/cdbi/26-mutator.t index 5a1cf8f..7042731 100644 --- a/t/cdbi/26-mutator.t +++ b/t/cdbi/26-mutator.t @@ -1,47 +1,40 @@ -use strict; -use Test::More; +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - plan skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@" - if $@; -} +use strict; +use warnings; -BEGIN { - eval "use DBD::SQLite"; - plan $@ - ? (skip_all => 'needs DBD::SQLite for testing') - : (tests => 6); -} +use Test::More; use lib 't/cdbi/testlib'; require Film; sub Film::accessor_name_for { - my ($class, $col) = @_; - return "sheep" if lc $col eq "numexplodingsheep"; - return $col; + my ($class, $col) = @_; + return "sheep" if lc $col eq "numexplodingsheep"; + return $col; } my $data = { - Title => 'Bad Taste', - Director => 'Peter Jackson', - Rating => 'R', + Title => 'Bad Taste', + Director => 'Peter Jackson', + Rating => 'R', }; my $bt; eval { - my $data = $data; - $data->{sheep} = 1; - ok $bt = Film->insert($data), "Modified accessor - with + my $data = $data; + $data->{sheep} = 1; + ok $bt = Film->insert($data), "Modified accessor - with accessor"; - isa_ok $bt, "Film"; + isa_ok $bt, "Film"; }; is $@, '', "No errors"; eval { - ok $bt->sheep(2), 'Modified accessor, set'; - ok $bt->update, 'Update'; + ok $bt->sheep(2), 'Modified accessor, set'; + ok $bt->update, 'Update'; }; is $@, '', "No errors"; +done_testing;