Commit | Line | Data |
e60dc79f |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
7 | |
8 | my $schema = DBICTest->init_schema(); |
9 | |
10 | plan tests => 6; |
11 | |
12 | { |
13 | my $rs = $schema->resultset("CD")->search({}); |
14 | |
15 | ok $rs->count; |
16 | is $rs, $rs->count, "resultset as number with results"; |
17 | ok $rs, "resultset as boolean always true"; |
18 | } |
19 | |
20 | { |
21 | my $rs = $schema->resultset("CD")->search({ title => "Does not exist" }); |
22 | |
23 | ok !$rs->count; |
24 | is $rs, $rs->count, "resultset as number without results"; |
25 | ok $rs, "resultset as boolean always true"; |
26 | } |