#!/usr/bin/perl

# Copryight (C) 2004-2005  Joshua Hoblitt
#
# $Id: 02_server_setup.t,v 1.6 2008-02-02 01:51:29 jhoblitt Exp $

use strict;
use warnings;

use Test::More tests => 2;

use lib qw( ./t ./lib );

use Nebulous::Server;
use Test::Nebulous;

Test::Nebulous->setup;

isa_ok(
    Nebulous::Server->new(
        dsn         => $NEB_DB,
        dbuser      => $NEB_USER,
        dbpasswd    => $NEB_PASS,
    ),
    "Nebulous::Server"
);

Test::Nebulous->setup;

eval {
    Nebulous::Server->new(
        dsn         => "DBI:mysql:database=foobar:host=localhost",
        dbuser      => "baz",
        dbpasswd    =>"boo",
    );
};
like( $@, qr/DBI connect.*? failed/, "bad dsn/user/pass" );

Test::Nebulous->cleanup;
