X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F15-accessor.t;h=85f8464f45c7f35d99b2ff7dd50e0821bb5ecd57;hb=b47fb9c0;hp=3419cf03aa41628bf09307b29a71463c29acac71;hpb=9381840da8471c9a17a0b641c99fd0b57178b839;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/15-accessor.t b/t/cdbi/15-accessor.t index 3419cf0..85f8464 100644 --- a/t/cdbi/15-accessor.t +++ b/t/cdbi/15-accessor.t @@ -1,28 +1,20 @@ +use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; + use strict; -use Test::More; +use warnings; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - if ($@) { - plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); - next; - } - eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 75); -} +use Test::More; +use lib 't/cdbi/testlib'; INIT { - #local $SIG{__WARN__} = - #sub { like $_[0], qr/clashes with built-in method/, $_[0] }; - use lib 't/cdbi/testlib'; - require Film; - require Actor; - require Director; + require Film; + require Actor; + require Director; - Actor->has_a(film => 'Film'); - Film->has_a(director => 'Director'); + Actor->has_a(film => 'Film'); + Film->has_a(director => 'Director'); - sub Class::DBI::sheep { ok 0; } + sub Class::DBI::sheep { ok 0; } } # Install the deprecation warning intercept here for the rest of the 08 dev cycle @@ -83,7 +75,7 @@ eval { my $data = { %$data }; $data->{NumExplodingSheep} = 1; ok my $bt = Film->find_or_create($data), - "find_or_create Modified accessor - find with column name"; + "find_or_create Modified accessor - find with column name"; isa_ok $bt, "Film"; is $bt->sheep, 1, 'sheep bursting violently'; }; @@ -93,19 +85,20 @@ eval { my $data = { %$data }; $data->{sheep} = 1; ok my $bt = Film->find_or_create($data), - "find_or_create Modified accessor - find with accessor"; + "find_or_create Modified accessor - find with accessor"; isa_ok $bt, "Film"; is $bt->sheep, 1, 'sheep bursting violently'; }; is $@, '', "No errors"; -TODO: { local $TODO = 'TODOifying failing tests, waiting for Schwern'; ok (1, 'remove me'); eval { my $data = { %$data }; $data->{NumExplodingSheep} = 3; ok my $bt = Film->find_or_create($data), - "find_or_create Modified accessor - create with column name"; + "find_or_create Modified accessor - create with column name"; isa_ok $bt, "Film"; + + local $TODO = 'TODOifying failing tests, waiting for Schwern'; is $bt->sheep, 3, 'sheep bursting violently'; }; is $@, '', "No errors"; @@ -114,8 +107,10 @@ eval { my $data = { %$data }; $data->{sheep} = 4; ok my $bt = Film->find_or_create($data), - "find_or_create Modified accessor - create with accessor"; + "find_or_create Modified accessor - create with accessor"; isa_ok $bt, "Film"; + + local $TODO = 'TODOifying failing tests, waiting for Schwern'; is $bt->sheep, 4, 'sheep bursting violently'; }; is $@, '', "No errors"; @@ -124,8 +119,9 @@ eval { my @film = Film->search({ sheep => 1 }); is @film, 2, "Can search with modified accessor"; }; -is $@, '', "No errors"; - +{ + local $TODO = 'TODOifying failing tests, waiting for Schwern'; + is $@, '', "No errors"; } { @@ -268,3 +264,5 @@ is $@, '', "No errors"; $_->discard_changes for ($naked, $sandl); } + +done_testing;