/[A3C]/t/00-action-StrixSQL.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

Annotation of /t/00-action-StrixSQL.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 161 - (hide annotations)
Sun Jun 15 16:11:17 2008 UTC (15 years, 10 months ago) by dpavlin
File MIME type: application/x-troff
File size: 905 byte(s)
Send SQL query to any strix site (possibly over ssh tunnel)
1 dpavlin 161 #!/usr/bin/env perl
2     use warnings;
3     use strict;
4    
5     =head1 DESCRIPTION
6    
7     A (very) basic test harness for the StrixSQL action.
8    
9     =cut
10    
11     use Jifty::Test tests => 10;
12    
13     # Make sure we can load the action
14     use_ok('A3C::Action::StrixSQL');
15    
16     my $action = Jifty::Test->web->new_action(
17     class => 'StrixSQL',
18     # current_user => $system_user,
19     # arguments => {}
20     );
21    
22     isa_ok( $action, 'A3C::Action::StrixSQL' );
23    
24     $action->argument_values({ strix => 'os-test0604-zg', sql => 'select now() as time' });
25     $action->run;
26    
27     ok( $action->result->success, 'result is success' );
28    
29     ok( my $coll = $action->result->content( 'sql' ), 'result content have sql' );
30    
31     isa_ok( $coll, 'A3C::SQL' );
32    
33     cmp_ok( $coll->count, '>', 0, 'count' );
34    
35     is_deeply( [ $coll->_column_names ], [ 'time' ], '_column_names' );
36    
37     ok( my $row = $coll->next, 'next' );
38    
39     isa_ok( $row, 'A3C::SQL::row' );
40    
41     ok( my $time = $row->time, 'row->time' );
42    
43     diag $time;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26