/[Frey]/trunk/t/02-Frey-DBI.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 /trunk/t/02-Frey-DBI.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 931 - (show annotations)
Mon Jan 5 23:21:30 2009 UTC (15 years, 3 months ago) by dpavlin
File MIME type: application/x-troff
File size: 623 byte(s)
rename
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 my $debug = @ARGV ? 1 : 0;
6
7 use Test::More tests => 7;
8 use lib 'lib';
9
10 use Data::Dump qw/dump/;
11
12 BEGIN {
13 use_ok('Frey::DBI');
14 }
15
16 my $dsn = 'DBI:SQLite:dbname=./test.sqlite';
17 my $sql = 'select 1';
18
19 eval { Frey::DBI->new( dsn => 'fake' ) };
20 ok( $@, 'fake dsn' );
21 diag $@ if $debug;
22
23 ok( my $o = Frey::DBI->new( dsn => $dsn, query => $sql, debug => $debug ), "new $dsn" );
24
25 ok( my $data = $o->dsn, 'dsn' );
26 diag dump( $dsn ) if $debug;
27 cmp_ok( $data, 'eq', $dsn, 'correct' );
28
29 ok( my $query = $o->query, 'query' );
30 diag dump( $query ) if $debug;
31 cmp_ok( $query, 'eq', $sql, $sql );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26