File: no-registry.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 (32 lines) | stat: -rw-r--r-- 712 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/perl -w

use strict;

use Test::More tests => 5 * 4;

BEGIN
{
  require 't/test-lib.pl';

  package My::DB;
  use base 'Rose::DB';
  My::DB->use_private_registry;
}

foreach my $type (qw(pg mysql informix sqlite oracle))
{
  SKIP:
  {
    skip("$type tests", 4)  unless(have_db($type));
    ok(my $db = My::DB->new(driver => $type), "empty $type");

    eval { $db = My::DB->new(driver => $type, type => 'nonesuch') };
    ok($@, "$type - with type");

    eval { $db = My::DB->new(driver => $type, domain => 'nonesuch') };
    ok($@, "$type - with domain");

    eval { $db = My::DB->new(driver => $type, type => 'nonesuch', domain => 'nonesuch') };
    ok($@, "$type - with type and domain");
  }
}