fix doubling of find_related condition
[dbsrgits/DBIx-Class.git] / t / resultset_overload.t
CommitLineData
e60dc79f 1use strict;
f54428ab 2use warnings;
e60dc79f 3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8my $schema = DBICTest->init_schema();
9
e60dc79f 10{
11 my $rs = $schema->resultset("CD")->search({});
12
13 ok $rs->count;
14 is $rs, $rs->count, "resultset as number with results";
15 ok $rs, "resultset as boolean always true";
16}
17
18{
19 my $rs = $schema->resultset("CD")->search({ title => "Does not exist" });
f54428ab 20
e60dc79f 21 ok !$rs->count;
22 is $rs, $rs->count, "resultset as number without results";
23 ok $rs, "resultset as boolean always true";
f54428ab 24}
25
26done_testing;