File: setup.t

package info (click to toggle)
librose-db-perl 0.786-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 840 kB
  • sloc: perl: 12,269; makefile: 9
file content (42 lines) | stat: -rwxr-xr-x 818 bytes parent folder | download | duplicates (7)
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
35
36
37
38
39
40
41
42
#!/usr/bin/perl -w

use strict;

use FindBin qw($Bin);

use lib "$Bin/lib";

use Test::More;

eval { require YAML::Syck };

if($@)
{
  eval { require YAML };

  plan(skip_all => 'YAML or YAML::Syck required for setup tests')  if($@); 
}

Test::More->import(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');
}