#!/usr/bin/perl

# Copryight (C) 2004-2005  Joshua Hoblitt
#
# $Id: 02_server_setup.t,v 1.8 2008-12-14 22:54:25 eugene 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;
