Commit | Line | Data |
2bb7b40b |
1 | sub run_tests { |
2 | my $schema = shift; |
3 | |
4 | plan tests => 5; |
5 | |
6 | my $rs = $cd = $schema->resultset("CD")->search({}); |
7 | |
8 | my $rs_title = $rs->get_column('title'); |
9 | my $rs_year = $rs->get_column('year'); |
10 | |
11 | is($rs_title->next, 'Spoonful of bees', "next okay"); |
12 | |
13 | my @all = $rs_title->all; |
14 | cmp_ok(scalar @all, '==', 5, "five titles returned"); |
15 | |
16 | cmp_ok($rs_year->max, '==', 2001, "max okay for year"); |
17 | is($rs_title->min, 'Caterwaulin\' Blues', "min okay for title"); |
18 | |
19 | cmp_ok($rs_year->sum, '==', 9996, "three artists returned"); |
20 | |
21 | } |
22 | |
23 | 1; |