IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 14, 2008, 12:54:25 PM (18 years ago)
Author:
eugene
Message:

reverting to pre-distributed version code (distrib is on branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/t/02_server_setup.t

    r20965 r20990  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 02_server_setup.t,v 1.7 2008-12-12 21:13:41 jhoblitt Exp $
     5# $Id: 02_server_setup.t,v 1.8 2008-12-14 22:54:25 eugene Exp $
    66
    77use strict;
    88use warnings;
    99
    10 use Test::More tests => 6;
     10use Test::More tests => 2;
    1111
    1212use lib qw( ./t ./lib );
     
    1717Test::Nebulous->setup;
    1818
    19 isa_ok(Nebulous::Server->new(), "Nebulous::Server");
     19isa_ok(
     20    Nebulous::Server->new(
     21        dsn         => $NEB_DB,
     22        dbuser      => $NEB_USER,
     23        dbpasswd    => $NEB_PASS,
     24    ),
     25    "Nebulous::Server"
     26);
    2027
    2128Test::Nebulous->setup;
    2229
    23 # ->new()
    24 {
    25     my $neb = Nebulous::Server->new( log_level => 'off' );
    26 
    27     ok($neb, "set log level");
    28 }
    29 
    30 Test::Nebulous->setup;
    31 
    32 {
    33     my $neb = Nebulous::Server->new(
     30eval {
     31    Nebulous::Server->new(
    3432        dsn         => "DBI:mysql:database=foobar:host=localhost",
    3533        dbuser      => "baz",
    3634        dbpasswd    =>"boo",
    3735    );
    38 
    39     ok($neb, "set database");
    40 }
    41 
    42 Test::Nebulous->setup;
    43 
    44 # add dbs after ->new()
    45 {
    46     my $neb = Nebulous::Server->new;
    47 
    48     ok($neb->config->add_db(
    49         dbindex    => 0,
    50         dsn         => "DBI:mysql:database=foobar:host=localhost",
    51         dbuser      => "baz",
    52         dbpasswd    =>"boo",
    53     ), "add db");
    54    
    55     ok($neb->config->add_db(
    56         dbindex    => 1,
    57         dsn         => "DBI:mysql:database=foobar:host=localhost",
    58         dbuser      => "baz",
    59         dbpasswd    =>"boo",
    60     ), "add dbs");
    61 
    62     is($neb->config->n_db, 2, "n dbs")
    63 }
     36};
     37like( $@, qr/DBI connect.*? failed/, "bad dsn/user/pass" );
    6438
    6539Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.