forked from UPC/ravada
-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_ravada.t
34 lines (25 loc) · 869 Bytes
/
05_ravada.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use warnings;
use strict;
use Test::More;
use Test::SQL::Data;
use_ok('Ravada');
ok(! $Ravada::CONNECTOR, "DB connector should be undef at load time");
my $test = Test::SQL::Data->new( config => 't/etc/sql.conf');
my $ravada = Ravada->new( connector => $test->connector
, config => 't/etc/ravada.conf'
, warn_error => 0
);
ok($Ravada::CONNECTOR, "Now we should have a DB connector ");
ok($Ravada::CONNECTOR,"No connector defined ");
eval { ok($Ravada::CONNECTOR->dbh,"No dbh defined ") };
eval {
my $config_err = "t/etc/ravada_miss.conf";
my $rvd_err = Ravada->new( connector => $test->connector, config => $config_err);
};
like($@,qr/Missing config file/);
eval {
my $config_err = "t/etc/ravada_err.conf";
my $rvd_err = Ravada->new( connector => $test->connector, config => $config_err);
};
like($@,qr/Format error/);
done_testing();