X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F02-Film.t;h=5d0f8607e4d859581db0103239486b6531cac357;hb=3225bc713250e9cd32a834aeec120ea996ea8431;hp=2eb4f0593aa2d47469d8ecdc1a2fa6a0cdd91ede;hpb=68de943862f06cabd397d2e74d12cd9cdc999779;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/cdbi/02-Film.t b/t/cdbi/02-Film.t index 2eb4f05..5d0f860 100644 --- a/t/cdbi/02-Film.t +++ b/t/cdbi/02-Film.t @@ -1,17 +1,11 @@ use strict; +use warnings; + use Test::More; use Scalar::Util 'refaddr'; use namespace::clean; $| = 1; -BEGIN { - eval "use DBIx::Class::CDBICompat;"; - if ($@) { - plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required'); - } - plan tests => 98; -} - INIT { use lib 't/cdbi/testlib'; use Film; @@ -35,10 +29,10 @@ is(Film->__driver, "SQLite", "Driver set correctly"); eval { my $id = Film->title }; #like $@, qr/class method/, "Can't get title with no object"; ok $@, "Can't get title with no object"; -} +} eval { my $duh = Film->insert; }; -like $@, qr/create needs a hashref/, "needs a hashref"; +like $@, qr/Result object instantiation requires a hashref as argument/, "needs a hashref"; ok +Film->create_test_film; @@ -229,7 +223,7 @@ ok( # Test that a disconnect doesnt harm anything. { - # SQLite is loud on disconnect/reconnect. + # SQLite is loud on disconnect/reconnect. # This is solved in DBIC but not in ContextualFetch local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ @@ -400,7 +394,7 @@ SKIP: { my $btaste4 = Film->retrieve('Bad Taste'); isnt refaddr $btaste2, refaddr $btaste4, "Clearing cache and retrieving again gives new object"; - + $btaste=Film->insert({ Title => 'Bad Taste 2', Director => 'Peter Jackson', @@ -410,5 +404,7 @@ SKIP: { $btaste2 = Film->retrieve('Bad Taste 2'); is refaddr $btaste, refaddr $btaste2, "Creating and retrieving gives ref to same object"; - + } + +done_testing;