/[A3C]/t/20-sql.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /t/20-sql.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (show annotations)
Fri Apr 11 23:22:03 2008 UTC (16 years ago) by dpavlin
File MIME type: application/x-troff
File size: 475 byte(s)
pissed by Jifty::Collection way of group_by, I opted to write
small wrapper class which will turn SQL query into Collection-like
object with proper accessors
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 =head1 DESCRIPTION
6
7 test SQL module
8
9 =cut
10
11 use Jifty::Test tests => 9;
12
13 use_ok('A3C::SQL');
14
15 my $query = 'select now()';
16
17 ok( my $sql = A3C::SQL->new({ query => $query }), 'new' );
18
19 isa_ok( $sql, 'A3C::SQL' );
20 is( $sql->query, $query, 'sql' );
21
22 cmp_ok( $sql->count, '==', 1, 'count' );
23
24 ok( my $row = $sql->next, 'next' );
25
26 isa_ok( $row, 'A3C::SQL::row' );
27
28 ok( $row->now, 'row has accessor' );
29
30 ok( ! $sql->next, 'last row' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26