Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
e60dc79f |
3 | use strict; |
f54428ab |
4 | use warnings; |
e60dc79f |
5 | |
6 | use Test::More; |
c0329273 |
7 | |
e60dc79f |
8 | use DBICTest; |
9 | |
10 | my $schema = DBICTest->init_schema(); |
11 | |
e60dc79f |
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" }); |
f54428ab |
22 | |
e60dc79f |
23 | ok !$rs->count; |
24 | is $rs, $rs->count, "resultset as number without results"; |
25 | ok $rs, "resultset as boolean always true"; |
f54428ab |
26 | } |
27 | |
28 | done_testing; |