File: setup.t

package info (click to toggle)
librose-db-perl 0.744-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 632 kB
  • ctags: 428
  • sloc: perl: 9,218; makefile: 10
file content (31 lines) | stat: -rwxr-xr-x 652 bytes parent folder | download
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
#!/usr/bin/perl -w

use strict;

use FindBin qw($Bin);

use lib "$Bin/lib";

use Test::More tests => 4;

$ENV{'ROSEDBRC'}       = "$Bin/rosedbrc";
$ENV{'ROSEDB_DEVINIT'} = rand > 0.5 ? 'My::FixUp' : "$Bin/lib/My/FixUp.pm";

use_ok('My::DB');

my $entry = My::DB->registry->entry(domain => 'somedomain', type => 'sometype');

is($entry->database, 'somevalue', 'ROSEDBRC 1');

$entry = My::DB->registry->entry(domain => 'otherdomain', type => 'othertype');

is($entry->host, 'othervalue', 'ROSEDBRC 2');

if($ENV{'ROSEDB_DEVINIT'} eq 'My::FixUp')
{
  is($entry->port, '456', 'ROSEDB_DEVINIT 1');
}
else
{
  is($entry->port, '789', 'ROSEDB_DEVINIT 1');
}