X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi-t%2F02-Film.t;h=f55d8cd437cc70cc85be758e1725a2709b719265;hb=58ff4acf704a746869ceb16668180f5472b9edef;hp=f47db3ba77cb5136b52a3763f7e25e9ea391943b;hpb=451517e7031ac72038f54a9750fac60dab0a4b3c;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi-t/02-Film.t b/t/cdbi-t/02-Film.t index f47db3b..f55d8cd 100644 --- a/t/cdbi-t/02-Film.t +++ b/t/cdbi-t/02-Film.t @@ -3,8 +3,13 @@ use Test::More; $| = 1; BEGIN { - eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 95); + 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 => 96); } INIT { @@ -80,6 +85,9 @@ $gone->update; cmp_ok(@films, '==', 2, "We have 2 films in total"); } +# EXTRA TEST: added by mst to check a bug found by Numa +cmp_ok(Film->count_all, '==', 2, "count_all confirms 2 films"); + my $gone_copy = Film->retrieve('Gone With The Wind'); ok($gone->NumExplodingSheep == 5, 'update()'); ok($gone->Rating eq 'NC-17', 'update() again'); @@ -159,6 +167,8 @@ eval { Film->create({ Title => 'Mikey and Nicky', Director => 'Elaine May' }); my $new_leaf = Film->create({ Title => 'A New Leaf', Director => 'Elaine May' }); + +#use Data::Dumper; die Dumper(Film->search( Director => 'Elaine May' )); cmp_ok(Film->search(Director => 'Elaine May'), '==', 3, "3 Films by Elaine May"); ok(Film->retrieve('Ishtar')->delete, @@ -226,7 +236,7 @@ is($btaste->Director, $orig_director, 'discard_changes()'); my $btaste2 = Film->retrieve($btaste->id); $btaste->NumExplodingSheep(18); my @warnings; - local $SIG{__WARN__} = sub { push @warnings, @_; }; + local $SIG{__WARN__} = sub { push(@warnings, @_); }; { # unhook from live object cache, so next one is not from cache