4 eval "use DBD::SQLite";
5 plan skip_all => 'needs DBD::SQLite for testing' if $@;
8 cmp_ok($schema->resultset("CD")->count({ 'artist.name' => 'Caterwauler McCrae' },
10 '==', 3, 'Count by has_a ok');
12 cmp_ok($schema->resultset("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }),
13 '==', 4, 'Count by has_many ok');
15 cmp_ok($schema->resultset("CD")->count(
16 { 'liner_notes.notes' => { '!=' => undef } },
17 { join => 'liner_notes' }),
18 '==', 3, 'Count by might_have ok');
20 cmp_ok($schema->resultset("CD")->count(
21 { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy',
22 'liner_notes.notes' => { 'like' => 'Buy%' } },
23 { join => [ qw/tags liner_notes/ ] } ),
24 '==', 2, "Mixed count ok");