X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2Fobject_cache.t;h=db0dc06df95bdf46e09356bb1918905f0f11ceac;hb=5c505cafa292b25dbbfb0df53ac30e73069834a2;hp=896f8eb3a8a23d1f84b5bcd8ac768df6078521ea;hpb=50891152d0b24649bfd67bdba97feec86b11c064;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/object_cache.t b/t/cdbi/object_cache.t index 896f8eb..db0dc06 100644 --- a/t/cdbi/object_cache.t +++ b/t/cdbi/object_cache.t @@ -1,27 +1,14 @@ +use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; + use strict; +use warnings; + use Test::More; $| = 1; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - if ($@) { - plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); - } - - eval "use DBD::SQLite"; - plan skip_all => 'needs DBD::SQLite for testing' if $@; -} - -INIT { - use lib 't/cdbi/testlib'; - use Film; -} - -plan skip_all => "Object cache is turned off" - if Film->isa("DBIx::Class::CDBICompat::NoObjectIndex"); - -plan tests => 5; +use lib 't/cdbi/testlib'; +use Film; ok +Film->create({ Title => 'This Is Spinal Tap', @@ -41,14 +28,14 @@ ok +Film->create({ { Film->nocache(1); - + my $film1 = Film->retrieve( "This Is Spinal Tap" ); my $film2 = Film->retrieve( "This Is Spinal Tap" ); $film1->Director("Marty DiBergi"); is $film2->Director, "Rob Reiner", 'caching turned off'; - + $film1->discard_changes; } @@ -80,3 +67,5 @@ ok +Film->create({ $film1->discard_changes; } + +done_testing;